partly import changes from tenfourfox: #651: M1761233 M1687303 M1633019 M1797336 M1799748 M1801102 (fb91afbb4)

This commit is contained in:
roytam1 2023-04-24 11:39:08 +08:00
commit ba3e46b173
4 changed files with 38 additions and 8 deletions

View file

@ -6750,7 +6750,11 @@ PresShell::RecordMouseLocation(WidgetGUIEvent* aEvent)
nsIFrame* GetNearestFrameContainingPresShell(nsIPresShell* aPresShell)
{
nsView* view = aPresShell->GetViewManager()->GetRootView();
nsViewManager* vm = aPresShell->GetViewManager();
if (!vm) {
return nullptr;
}
nsView* view = vm->GetRootView();
while (view && !view->GetFrame()) {
view = view->GetParent();
}