Bug 1875274 - Use the same manner on Android as we do for desktops to get the corresponding nsIWidget in ZoomConstraintsClient. r=emilio,tnikkel

Differential Revision: https://phabricator.services.mozilla.com/D200255
This commit is contained in:
Hiroyuki Ikezoe 2024-02-01 21:03:25 +00:00
parent 4b51e7b0bf
commit 6fba493a38

View File

@ -53,13 +53,9 @@ static nsIWidget* GetWidget(PresShell* aPresShell) {
return nullptr;
}
if (nsIFrame* rootFrame = aPresShell->GetRootFrame()) {
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_UIKIT)
return rootFrame->GetNearestWidget();
#else
if (nsView* view = rootFrame->GetView()) {
return view->GetWidget();
}
#endif
}
return nullptr;
}