Bug 1139464 - In GetNearestScrollableFrame(), associate the root APZC with the root scroll frame of the root document (whether chrome or content), not the root content document. r=kats,tn

--HG--
extra : source : 2ab85f9edf4d74962ca6bede6669cfc28b6b8e15
This commit is contained in:
Botond Ballo 2015-03-11 17:10:15 -04:00
parent 81d959605e
commit 70559e5194
2 changed files with 6 additions and 5 deletions

View File

@ -1833,9 +1833,10 @@ nsLayoutUtils::GetNearestScrollableFrame(nsIFrame* aFrame, uint32_t aFlags)
return scrollableFrame;
}
if (aFlags & SCROLLABLE_ALWAYS_MATCH_ROOT) {
nsPresContext* pc = f->PresContext();
if (pc->IsRootContentDocument() && pc->PresShell()->GetRootFrame() == f) {
return pc->PresShell()->GetRootScrollFrameAsScrollable();
nsIPresShell* ps = f->PresContext()->PresShell();
if (ps->GetDocument() && ps->GetDocument()->IsRootDisplayDocument() &&
ps->GetRootFrame() == f) {
return ps->GetRootScrollFrameAsScrollable();
}
}
}

View File

@ -588,8 +588,8 @@ public:
SCROLLABLE_ONLY_ASYNC_SCROLLABLE = 0x04,
/**
* If the SCROLLABLE_ALWAYS_MATCH_ROOT flag is set, then return the
* root scrollable frame for the root content document if we don't hit
* anything else.
* root scrollable frame for the root document (in the current process)
* if we don't hit anything else.
*/
SCROLLABLE_ALWAYS_MATCH_ROOT = 0x08,
};