Bug 1948522 - Use the display root frame as the root frame for popup in RestrictToRootDisplayPort. r=botond

This change is similar to the previous change, but for displayport.

Differential Revision: https://phabricator.services.mozilla.com/D238555
This commit is contained in:
Hiroyuki Ikezoe
2025-02-20 03:29:39 +00:00
parent d2dc139f89
commit 1e2838636c

View File

@@ -4293,7 +4293,10 @@ nsRect ScrollContainerFrame::RestrictToRootDisplayPort(
return aDisplayportBase;
}
const mozilla::PresShell* const rootPresShell = rootPresContext->PresShell();
nsIFrame* rootFrame = rootPresShell->GetRootScrollContainerFrame();
nsIFrame* displayRootFrame = nsLayoutUtils::GetDisplayRootFrame(this);
nsIFrame* rootFrame = displayRootFrame->IsMenuPopupFrame()
? displayRootFrame
: rootPresShell->GetRootScrollContainerFrame();
if (!rootFrame) {
rootFrame = rootPresShell->GetRootFrame();
}