Bug 1560770 - Use a method of getting the widget in UseMobileViewportManager() than does not require the frame tree to be constructed. r=tnikkel

Differential Revision: https://phabricator.services.mozilla.com/D50121

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Botond Ballo 2019-10-22 20:40:35 +00:00
Родитель cfdcf5a828
Коммит 432e039626
1 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -10506,10 +10506,12 @@ RefPtr<MobileViewportManager> PresShell::GetMobileViewportManager() const {
bool UseMobileViewportManager(PresShell* aPresShell, Document* aDocument) {
// If we're not using APZ, we won't be able to zoom, so there is no
// point in having an MVM.
if (nsPresContext* presContext = aPresShell->GetPresContext()) {
if (nsIWidget* widget = presContext->GetNearestWidget()) {
if (!widget->AsyncPanZoomEnabled()) {
return false;
if (nsViewManager* viewManager = aPresShell->GetViewManager()) {
if (nsView* view = viewManager->GetRootView()) {
if (nsIWidget* widget = view->GetNearestWidget(nullptr)) {
if (!widget->AsyncPanZoomEnabled()) {
return false;
}
}
}
}