Bug 1309720, ensure expected DOM tree operations when calling insertBefore, r=ehsan

This commit is contained in:
Olli Pettay
2016-10-14 15:33:42 +03:00
parent 6f19ca1a32
commit 45a7bbd8ea
12 changed files with 33 additions and 17 deletions

View File

@@ -587,7 +587,8 @@ HTMLSelectElement::Add(nsGenericHTMLElement& aElement,
// If the before parameter is not null, we are equivalent to the
// insertBefore method on the parent of before.
parent->InsertBefore(aElement, aBefore, aError);
nsCOMPtr<nsINode> refNode = aBefore;
parent->InsertBefore(aElement, refNode, aError);
}
NS_IMETHODIMP