Bug 1362462: Fallback to main document widget for frames which haven't been inserted yet. r=mconley

MozReview-Commit-ID: Ayr2kQ9KqbW

--HG--
extra : rebase_source : db78c2c13f87357f64085685629c0e2f96a5acbf
This commit is contained in:
Kris Maglione 2017-05-29 13:16:23 -07:00
parent 30acdf7a94
commit 3f8c999795
2 changed files with 6 additions and 0 deletions

View File

@ -2519,6 +2519,9 @@ TabParent::GetWidget() const
return nullptr;
}
nsCOMPtr<nsIWidget> widget = nsContentUtils::WidgetForContent(mFrameElement);
if (!widget) {
widget = nsContentUtils::WidgetForDocument(mFrameElement->OwnerDoc());
}
return widget.forget();
}

View File

@ -217,6 +217,9 @@ RenderFrameParent::AttachLayerManager()
if (content) {
lm = nsContentUtils::LayerManagerForContent(content);
}
if (!lm) {
lm = GetFrom(mFrameLoader);
}
}
// Perhaps the document containing this frame currently has no presentation?