Reviewed by Darin.
authorap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 27 Oct 2007 08:16:26 +0000 (08:16 +0000)
committerap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 27 Oct 2007 08:16:26 +0000 (08:16 +0000)
        http://bugs.webkit.org/show_bug.cgi?id=15467
        Setting innerHTML to blank string in application/xhtml+xml mode
        throws DOM Exception 7

        Test: fast/dom/blank-innerHTML.xhtml

        * dom/XMLTokenizer.cpp:
        (WebCore::parseXMLDocumentFragment): Bail out early if the input string is empty.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27144 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/dom/blank-innerHTML-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/blank-innerHTML.xhtml [new file with mode: 0644]
WebCore/ChangeLog
WebCore/dom/XMLTokenizer.cpp

index 78ea2d7237e42aab01c48ece70b74a0cb985f830..a290f680655c52ebff62383e589618e7ccbce66c 100644 (file)
@@ -1,3 +1,16 @@
+2007-10-27  Alexey Proskuryakov  <ap@webkit.org>
+
+        Reviewed by Darin.
+
+        Test by Christopher Rogers <christorogers@gmail.com>.
+
+        http://bugs.webkit.org/show_bug.cgi?id=15467
+        Setting innerHTML to blank string in application/xhtml+xml mode
+        throws DOM Exception 7
+
+        * fast/dom/blank-innerHTML-expected.txt: Added.
+        * fast/dom/blank-innerHTML.xhtml: Added.
+
 2007-10-26  Tristan O'Tierney  <tristan@apple.com>
 
         Reviewed by Darin Adler.
diff --git a/LayoutTests/fast/dom/blank-innerHTML-expected.txt b/LayoutTests/fast/dom/blank-innerHTML-expected.txt
new file mode 100644 (file)
index 0000000..cb40654
--- /dev/null
@@ -0,0 +1 @@
+This test did pass.
diff --git a/LayoutTests/fast/dom/blank-innerHTML.xhtml b/LayoutTests/fast/dom/blank-innerHTML.xhtml
new file mode 100644 (file)
index 0000000..a5c1c6b
--- /dev/null
@@ -0,0 +1,13 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+</head>
+<body>
+    This test did <span id="not">NOT</span> pass.
+    <script type="text/javascript">
+        if (window.layoutTestController)
+            layoutTestController.dumpAsText();
+        document.getElementById('not').innerHTML = '';
+    </script>
+</body>
+</html>
index a9de65eda65b046bcef474a4873037a7a5d5892d..bc4d9c01dd56e04241087169f6a53c7b9ba72b66 100644 (file)
@@ -1,3 +1,16 @@
+2007-10-27  Alexey Proskuryakov  <ap@webkit.org>
+
+        Reviewed by Darin.
+
+        http://bugs.webkit.org/show_bug.cgi?id=15467
+        Setting innerHTML to blank string in application/xhtml+xml mode
+        throws DOM Exception 7
+
+        Test: fast/dom/blank-innerHTML.xhtml
+
+        * dom/XMLTokenizer.cpp:
+        (WebCore::parseXMLDocumentFragment): Bail out early if the input string is empty.
+
 2007-10-26  Sam Weinig  <sam@webkit.org>
 
         Enable dragging the left sidebar using the separator.
index 73f698958d0e8b8659e89c5f4a7f7a6876be2b4c..7abdad7cb1cb7d9652bfe663bb7aea7e7c5027be 100644 (file)
@@ -1502,6 +1502,9 @@ static void balancedWarningHandler(void* closure, const char* message, ...)
 #endif
 bool parseXMLDocumentFragment(const String& string, DocumentFragment* fragment, Element* parent)
 {
+    if (!string.length())
+        return true;
+
     XMLTokenizer tokenizer(fragment, parent);
     
 #ifndef USE_QXMLSTREAM