Title: [136717] trunk/Source/WebCore
Revision
136717
Author
[email protected]
Date
2012-12-05 11:02:06 -0800 (Wed, 05 Dec 2012)

Log Message

DOMImplementation.createDocument should call appendChild rather than parserAppendChild to add docType and documentElement
https://bugs.webkit.org/show_bug.cgi?id=104040

Reviewed by Ojan Vafai.

createDocument now calls appendChild.

No new tests (no observable changes).

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::parserAppendChild):
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (136716 => 136717)


--- trunk/Source/WebCore/ChangeLog	2012-12-05 19:00:14 UTC (rev 136716)
+++ trunk/Source/WebCore/ChangeLog	2012-12-05 19:02:06 UTC (rev 136717)
@@ -1,3 +1,19 @@
+2012-12-05  Rafael Weinstein  <[email protected]>
+
+        DOMImplementation.createDocument should call appendChild rather than parserAppendChild to add docType and documentElement
+        https://bugs.webkit.org/show_bug.cgi?id=104040
+
+        Reviewed by Ojan Vafai.
+
+        createDocument now calls appendChild.
+
+        No new tests (no observable changes).
+
+        * dom/ContainerNode.cpp:
+        (WebCore::ContainerNode::parserAppendChild):
+        * dom/DOMImplementation.cpp:
+        (WebCore::DOMImplementation::createDocument):
+
 2012-12-05  Alec Flett  <[email protected]>
 
         IndexedDB: Stub out transaction-backend methods

Modified: trunk/Source/WebCore/dom/ContainerNode.cpp (136716 => 136717)


--- trunk/Source/WebCore/dom/ContainerNode.cpp	2012-12-05 19:00:14 UTC (rev 136716)
+++ trunk/Source/WebCore/dom/ContainerNode.cpp	2012-12-05 19:02:06 UTC (rev 136717)
@@ -679,9 +679,7 @@
     ASSERT(newChild);
     ASSERT(!newChild->parentNode()); // Use appendChild if you need to handle reparenting (and want DOM mutation events).
     ASSERT(!newChild->isDocumentFragment());
-    // FIXME: This assert should be valid, but DOMImplementation::createDocument()
-    // blindly calls paserAppendChild on the docType its passed.
-    // ASSERT(document() == newChild->document());
+    ASSERT(document() == newChild->document());
 
     Node* last = m_lastChild;
     {

Modified: trunk/Source/WebCore/dom/DOMImplementation.cpp (136716 => 136717)


--- trunk/Source/WebCore/dom/DOMImplementation.cpp	2012-12-05 19:00:14 UTC (rev 136716)
+++ trunk/Source/WebCore/dom/DOMImplementation.cpp	2012-12-05 19:02:06 UTC (rev 136717)
@@ -315,11 +315,10 @@
         return 0;
     }
 
-    // FIXME: Shouldn't this call appendChild instead?
     if (doctype)
-        doc->parserAppendChild(doctype);
+        doc->appendChild(doctype);
     if (documentElement)
-        doc->parserAppendChild(documentElement.release());
+        doc->appendChild(documentElement.release());
 
     return doc.release();
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to