diff options
author | Boris Zbarsky <bzbarsky@mit.edu> | 2018-05-31 12:43:01 -0400 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-06-07 15:55:55 +0200 |
commit | fa47c8d42743bc39e8501c4652d228cb8023597c (patch) | |
tree | 466e01a1c41f57d0f5e9f68df5cd7d3fa6569359 | |
parent | 887e2c8b190e9586f10ac16a3a90ec209ec6b7bb (diff) | |
download | UXP-fa47c8d42743bc39e8501c4652d228cb8023597c.tar UXP-fa47c8d42743bc39e8501c4652d228cb8023597c.tar.gz UXP-fa47c8d42743bc39e8501c4652d228cb8023597c.tar.lz UXP-fa47c8d42743bc39e8501c4652d228cb8023597c.tar.xz UXP-fa47c8d42743bc39e8501c4652d228cb8023597c.zip |
Bug 1464784 - Hold a strong ref to the document in callers of ConvertNodesOrStringsIntoNode. r=smaug, a=abillings
-rw-r--r-- | dom/base/nsINode.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/dom/base/nsINode.cpp b/dom/base/nsINode.cpp index 715ca93ea..09e848710 100644 --- a/dom/base/nsINode.cpp +++ b/dom/base/nsINode.cpp @@ -1777,8 +1777,8 @@ nsINode::Before(const Sequence<OwningNodeOrString>& aNodes, nsCOMPtr<nsINode> viablePreviousSibling = FindViablePreviousSibling(*this, aNodes); - nsCOMPtr<nsINode> node = - ConvertNodesOrStringsIntoNode(aNodes, OwnerDoc(), aRv); + nsCOMPtr<nsIDocument> doc = OwnerDoc(); + nsCOMPtr<nsINode> node = ConvertNodesOrStringsIntoNode(aNodes, doc, aRv); if (aRv.Failed()) { return; } @@ -1800,8 +1800,8 @@ nsINode::After(const Sequence<OwningNodeOrString>& aNodes, nsCOMPtr<nsINode> viableNextSibling = FindViableNextSibling(*this, aNodes); - nsCOMPtr<nsINode> node = - ConvertNodesOrStringsIntoNode(aNodes, OwnerDoc(), aRv); + nsCOMPtr<nsIDocument> doc = OwnerDoc(); + nsCOMPtr<nsINode> node = ConvertNodesOrStringsIntoNode(aNodes, doc, aRv); if (aRv.Failed()) { return; } @@ -1820,8 +1820,8 @@ nsINode::ReplaceWith(const Sequence<OwningNodeOrString>& aNodes, nsCOMPtr<nsINode> viableNextSibling = FindViableNextSibling(*this, aNodes); - nsCOMPtr<nsINode> node = - ConvertNodesOrStringsIntoNode(aNodes, OwnerDoc(), aRv); + nsCOMPtr<nsIDocument> doc = OwnerDoc(); + nsCOMPtr<nsINode> node = ConvertNodesOrStringsIntoNode(aNodes, doc, aRv); if (aRv.Failed()) { return; } @@ -1880,8 +1880,8 @@ void nsINode::Prepend(const Sequence<OwningNodeOrString>& aNodes, ErrorResult& aRv) { - nsCOMPtr<nsINode> node = - ConvertNodesOrStringsIntoNode(aNodes, OwnerDoc(), aRv); + nsCOMPtr<nsIDocument> doc = OwnerDoc(); + nsCOMPtr<nsINode> node = ConvertNodesOrStringsIntoNode(aNodes, doc, aRv); if (aRv.Failed()) { return; } @@ -1894,8 +1894,8 @@ void nsINode::Append(const Sequence<OwningNodeOrString>& aNodes, ErrorResult& aRv) { - nsCOMPtr<nsINode> node = - ConvertNodesOrStringsIntoNode(aNodes, OwnerDoc(), aRv); + nsCOMPtr<nsIDocument> doc = OwnerDoc(); + nsCOMPtr<nsINode> node = ConvertNodesOrStringsIntoNode(aNodes, doc, aRv); if (aRv.Failed()) { return; } |