Bug 1249377 - Hold a strong reference to |root| in nsHTMLDocument::SetBody. r=bz

This commit is contained in:
Andrew McCreight 2016-02-19 06:26:07 -08:00
parent 536547f4bf
commit 5e75403abe

View File

@ -1034,7 +1034,7 @@ nsHTMLDocument::SetBody(nsIDOMHTMLElement* aBody)
void
nsHTMLDocument::SetBody(nsGenericHTMLElement* newBody, ErrorResult& rv)
{
Element* root = GetRootElement();
nsCOMPtr<Element> root = GetRootElement();
// The body element must be either a body tag or a frameset tag. And we must
// have a html root tag, otherwise GetBody will not return the newly set