Test cases added:
* layout-tests/dom/html/level2/core/hc_nodedocumentfragmentnormalize2-expected.txt:
This passes now.
* khtml/xml/dom_nodeimpl.cpp:
(DOM::NodeImpl::normalize):
If there's a single empty text child, remove it.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@10174
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
-Test: http://www.w3.org/2001/DOM-Test-Suite/level2/core/hc_nodedocumentfragmentnormalize2
-Status: failure
-Detail: noChild: assertNull failed, actual [object Text]
+Test: http://www.w3.org/2001/DOM-Test-Suite/level2/core/hc_nodedocumentfragmentnormalize2
+Status: Success
+2005-08-14 Anders Carlsson <andersca@mac.com>
+
+ Reviewed and landed by Darin.
+
+ Test cases added:
+ * layout-tests/dom/html/level2/core/hc_nodedocumentfragmentnormalize2-expected.txt:
+ This passes now.
+
+ * khtml/xml/dom_nodeimpl.cpp:
+ (DOM::NodeImpl::normalize):
+ If there's a single empty text child, remove it.
+
2005-08-14 Anders Carlsson <andersca@mac.com>
Reviewed and landed by Darin.
child = nextChild;
}
}
+
+ // Check if we have a single empty text node left and remove it if so
+ child = firstChild();
+ if (child && !child->nextSibling() && child->isTextNode()) {
+ TextImpl *text = static_cast<TextImpl*>(child);
+ if (text->data().isEmpty())
+ removeChild(child, exceptioncode);
+ }
}
const AtomicString& NodeImpl::prefix() const