mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1237825. Find the root scroll frame even if the root element doesn't have a primary frame. r=mstange
Even though the content of the root scroll frame is the root element, the primary frame of the root element is never the root scroll frame. This is even true if the normal primary frame of the root element is not created (say because it is display: none). Leaving the primary frame of the root element to be null even though there are frames (the root scroll frame, and the canvas frame) that have the root element as their content. This behaviour is more consistent by not ignoring a root scroll frame when it exists.
This commit is contained in:
parent
7240464401
commit
dac35ad370
@ -866,11 +866,15 @@ nsIFrame*
|
||||
GetScrollFrameFromContent(nsIContent* aContent)
|
||||
{
|
||||
nsIFrame* frame = aContent->GetPrimaryFrame();
|
||||
if (frame && aContent->OwnerDoc()->GetRootElement() == aContent) {
|
||||
if (aContent->OwnerDoc()->GetRootElement() == aContent) {
|
||||
nsIPresShell* presShell = frame ? frame->PresContext()->PresShell() : nullptr;
|
||||
if (!presShell) {
|
||||
presShell = aContent->OwnerDoc()->GetShell();
|
||||
}
|
||||
// We want the scroll frame, the root scroll frame differs from all
|
||||
// others in that the primary frame is not the scroll frame.
|
||||
if (nsIFrame* rootScrollFrame =
|
||||
frame->PresContext()->PresShell()->GetRootScrollFrame()) {
|
||||
nsIFrame* rootScrollFrame = presShell ? presShell->GetRootScrollFrame() : nullptr;
|
||||
if (rootScrollFrame) {
|
||||
frame = rootScrollFrame;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user