http://bugs.webkit.org/show_bug.cgi?id=16731
Incorrect node type for whitespace when setting innerHTML in an XHTML document
Test: fast/dom/xhtml-fragment-whitespace.xhtml
* dom/XMLTokenizer.cpp: (WebCore::parseXMLDocumentFragment):
Use balancedCharactersHandler for ignorable whitespace.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29211
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2008-01-06 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Darin.
+
+ http://bugs.webkit.org/show_bug.cgi?id=16731
+ Incorrect node type for whitespace when setting innerHTML in an XHTML document
+
+ * fast/dom/xhtml-fragment-whitespace-expected.txt: Added.
+ * fast/dom/xhtml-fragment-whitespace.xhtml: Added.
+
2008-01-06 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
--- /dev/null
+Test for bug 16731: Incorrect node type for whitespace when setting innerHTML in an XHTML document.
+
+SUCCESS
--- /dev/null
+<html xmlns="http://www.w3.org/1999/xhtml">
+<script>
+function test() {
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ var target = document.getElementById('target');
+
+ target.innerHTML += "\t<p></p>";
+ if (target.firstChild.nodeName == "#text")
+ target.innerHTML = "SUCCESS";
+ else
+ target.innerHTML = "FAIL. Incorrect node type for whitespace: " + target.firstChild.nodeName + ".";
+}
+</script>
+<body onload="test();">
+ <p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=16731">bug 16731</a>:
+ Incorrect node type for whitespace when setting innerHTML in an XHTML document.</p>
+ <div id="target"></div>
+</body>
+</html>
+2008-01-06 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Darin.
+
+ http://bugs.webkit.org/show_bug.cgi?id=16731
+ Incorrect node type for whitespace when setting innerHTML in an XHTML document
+
+ Test: fast/dom/xhtml-fragment-whitespace.xhtml
+
+ * dom/XMLTokenizer.cpp: (WebCore::parseXMLDocumentFragment):
+ Use balancedCharactersHandler for ignorable whitespace.
+
2008-01-06 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
sax.startElementNs = balancedStartElementNsHandler;
sax.endElementNs = balancedEndElementNsHandler;
sax.cdataBlock = balancedCdataBlockHandler;
- sax.ignorableWhitespace = balancedCdataBlockHandler;
+ sax.ignorableWhitespace = balancedCharactersHandler;
sax.comment = balancedCommentHandler;
sax.warning = balancedWarningHandler;
sax.initialized = XML_SAX2_MAGIC;