mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 845337. When we are looking for the parent prescontext we may not have a root frame so use the root view instead to get the parent prescontext. r=roc
This commit is contained in:
parent
50c84383be
commit
6a5cba3ab2
@ -1152,11 +1152,21 @@ nsPresContext::GetParentPresContext()
|
||||
{
|
||||
nsIPresShell* shell = GetPresShell();
|
||||
if (shell) {
|
||||
nsIFrame* rootFrame = shell->FrameManager()->GetRootFrame();
|
||||
if (rootFrame) {
|
||||
nsIFrame* f = nsLayoutUtils::GetCrossDocParentFrame(rootFrame);
|
||||
if (f)
|
||||
return f->PresContext();
|
||||
nsViewManager* viewManager = shell->GetViewManager();
|
||||
if (viewManager) {
|
||||
nsView* view = viewManager->GetRootView();
|
||||
if (view) {
|
||||
view = view->GetParent(); // anonymous inner view
|
||||
if (view) {
|
||||
view = view->GetParent(); // subdocumentframe's view
|
||||
if (view) {
|
||||
nsIFrame* f = view->GetFrame();
|
||||
if (f) {
|
||||
return f->PresContext();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
|
Loading…
Reference in New Issue
Block a user