author | Timothy Nikkel <tnikkel@gmail.com> |
Wed, 27 Feb 2013 14:52:06 -0600 | |
changeset 123210 | 3d20e0577cbf7d5bcdf7b29affb64b41d1dbab55 |
parent 123209 | ae360bf4bc473dffe40da66400d9d8f9dcee0756 |
child 123211 | 8cb9d69819783558ec4fc67c43ad59208682987d |
push id | 24373 |
push user | ryanvm@gmail.com |
push date | Thu, 28 Feb 2013 01:36:21 +0000 |
treeherder | mozilla-central@8cb9d6981978 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | roc |
bugs | 845337 |
milestone | 22.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -1147,21 +1147,31 @@ nsPresContext::Observe(nsISupports* aSub return NS_ERROR_FAILURE; } nsPresContext* 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; } nsPresContext* nsPresContext::GetToplevelContentDocumentPresContext() {