Bug 906301 - Follow the DOM specs more strictly in case of mutations. r=peterv, a=abillings
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Wed, 21 Aug 2013 19:08:23 +0300
changeset 153830 a7b75c5af99af64934c263551ac2c79bd54855b3
parent 153829 18fab23c0fed0068d17f5ebad91a1fc5bd3ff4a6
child 153831 61cbf67c2fc424377c3a84e9620aafa367c8f675
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv, abillings
bugs906301
milestone25.0a2
Bug 906301 - Follow the DOM specs more strictly in case of mutations. r=peterv, a=abillings
content/base/src/nsINode.cpp
--- a/content/base/src/nsINode.cpp
+++ b/content/base/src/nsINode.cpp
@@ -1803,17 +1803,17 @@ nsINode::ReplaceOrInsertBefore(bool aRep
       // Verify that nodeToInsertBefore, if non-null, is still our child.  If
       // it's not, there's no way we can do this insert sanely; just bail out.
       if (nodeToInsertBefore && nodeToInsertBefore->GetParent() != this) {
         aError.Throw(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR);
         return nullptr;
       }
 
       // Verify that newContent has no parent.
-      if (newContent->GetParent()) {
+      if (newContent->GetParentNode()) {
         aError.Throw(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR);
         return nullptr;
       }
 
       // And verify that newContent is still allowed as our child.
       if (aNewChild == aRefChild) {
         // We've already removed aRefChild.  So even if we were doing a replace,
         // now we're doing a simple insert before nodeToInsertBefore.
@@ -1880,17 +1880,17 @@ nsINode::ReplaceOrInsertBefore(bool aRep
       // it's not, there's no way we can do this insert sanely; just bail out.
       if (nodeToInsertBefore && nodeToInsertBefore->GetParent() != this) {
         aError.Throw(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR);
         return nullptr;
       }
 
       // Verify that all the things in fragChildren have no parent.
       for (uint32_t i = 0; i < count; ++i) {
-        if (fragChildren.ref().ElementAt(i)->GetParent()) {
+        if (fragChildren.ref().ElementAt(i)->GetParentNode()) {
           aError.Throw(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR);
           return nullptr;
         }
       }
 
       // Note that unlike the single-element case above, none of our kids can
       // be aRefChild, so we can always pass through aReplace in the
       // IsAllowedAsChild checks below and don't have to worry about whether