[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:18:30 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit cffd039f55e641d7b1beb234e5f64635a20e18d4
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Dec 12 01:32:59 2003 +0000

            Reviewed by Darin.
    
    	<rdar://problem/3507863>: XMLHttpRequest should not parse response if HTML
    
    	* khtml/ecma/xmlhttprequest.cpp:
            (KJS::XMLHttpRequest::getValueProperty):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5775 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 36f6b69..f19f4b2 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,12 @@
+2003-12-11  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by Darin. 
+
+	<rdar://problem/3507863>: XMLHttpRequest should not parse response if HTML
+        
+	* khtml/ecma/xmlhttprequest.cpp:
+        (KJS::XMLHttpRequest::getValueProperty):
+
 2003-12-11  Richard Williamson   <rjw at apple.com>
 
 	Cleaned up and verified reference counting scheme, and
diff --git a/WebCore/khtml/ecma/xmlhttprequest.cpp b/WebCore/khtml/ecma/xmlhttprequest.cpp
index 34593e0..da510bd 100644
--- a/WebCore/khtml/ecma/xmlhttprequest.cpp
+++ b/WebCore/khtml/ecma/xmlhttprequest.cpp
@@ -144,19 +144,24 @@ Value XMLHttpRequest::getValueProperty(ExecState *exec, int token) const
       
       if (mimeType == "text/xml" || mimeType == "application/xml" || mimeType == "application/xhtml+xml") {
 	responseXML = DOM::Document(doc->implementation()->createDocument());
+
+	DOM::DocumentImpl *docImpl = static_cast<DOM::DocumentImpl *>(responseXML.handle());
+	
+	docImpl->open();
+	docImpl->write(response);
+	docImpl->finishParsing();
+	docImpl->close();
+	typeIsXML = true;
       } else {
-	responseXML = DOM::Document(doc->implementation()->createHTMLDocument());
+	typeIsXML = false;
       }
-
-      DOM::DocumentImpl *docImpl = static_cast<DOM::DocumentImpl *>(responseXML.handle());
-      
-      docImpl->open();
-      docImpl->write(response);
-      docImpl->finishParsing();
-      docImpl->close();
       createdDocument = true;
     }
 
+    if (!typeIsXML) {
+      return Undefined();
+    }
+
     return getDOMNode(exec,responseXML);
   case Status:
     return getStatus();
diff --git a/WebCore/khtml/ecma/xmlhttprequest.h b/WebCore/khtml/ecma/xmlhttprequest.h
index cab43d3..c920013 100644
--- a/WebCore/khtml/ecma/xmlhttprequest.h
+++ b/WebCore/khtml/ecma/xmlhttprequest.h
@@ -112,6 +112,7 @@ namespace KJS {
 
     QString response;
     mutable bool createdDocument;
+    mutable bool typeIsXML;
     mutable DOM::Document responseXML;
 
     bool aborted;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list