diff options
author | Olli Pettay <Olli.Pettay@helsinki.fi> | 2016-11-16 23:37:41 +0100 |
---|---|---|
committer | Pale Moon <git-repo@palemoon.org> | 2016-11-16 23:37:41 +0100 |
commit | afaa122df5a839ccf1e5c6cd8f6ce548c35fc741 (patch) | |
tree | 366c1e2313c37169cb9f429bab28c5f2d56a49c2 /dom/base/nsTreeSanitizer.cpp | |
parent | b612ef8d8a97d340bef2a849b1c41edfac07f8ff (diff) | |
download | palemoon-gre-afaa122df5a839ccf1e5c6cd8f6ce548c35fc741.tar.gz |
Ensure expected DOM tree operations when calling insertBefore.
Diffstat (limited to 'dom/base/nsTreeSanitizer.cpp')
-rw-r--r-- | dom/base/nsTreeSanitizer.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/dom/base/nsTreeSanitizer.cpp b/dom/base/nsTreeSanitizer.cpp index 737bc46ff..f407585a7 100644 --- a/dom/base/nsTreeSanitizer.cpp +++ b/dom/base/nsTreeSanitizer.cpp @@ -1433,7 +1433,8 @@ nsTreeSanitizer::SanitizeChildren(nsINode* aRoot) nsCOMPtr<nsIContent> child; // Must keep the child alive during move ErrorResult rv; while ((child = node->GetFirstChild())) { - parent->InsertBefore(*child, node, rv); + nsCOMPtr<nsINode> refNode = node; + parent->InsertBefore(*child, refNode, rv); if (rv.Failed()) { break; } |