summaryrefslogtreecommitdiffstats
path: root/layout/base/ZoomConstraintsClient.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--layout/base/ZoomConstraintsClient.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/layout/base/ZoomConstraintsClient.cpp b/layout/base/ZoomConstraintsClient.cpp
index e695c7755e..e9be0c2073 100644
--- a/layout/base/ZoomConstraintsClient.cpp
+++ b/layout/base/ZoomConstraintsClient.cpp
@@ -53,9 +53,20 @@ static nsIWidget* GetWidget(PresShell* aPresShell) {
return nullptr;
}
if (nsIFrame* rootFrame = aPresShell->GetRootFrame()) {
+#if defined(MOZ_WIDGET_ANDROID)
+ // On Android in cases of about:XX pages loaded in the browser parent
+ // process we need to return the nearest widget since it's the widget owning
+ // an IAPZCTreeManager to communicate with the APZCTreeManager for the
+ // browser.
+ // In bug 1648427 we will apply this code to desktops as well to make
+ // about pages zoomable on desktops, but it will be involving more works,
+ // see https://bugzilla.mozilla.org/show_bug.cgi?id=1648427#c7 .
+ return rootFrame->GetNearestWidget();
+#else
if (nsView* view = rootFrame->GetView()) {
return view->GetWidget();
}
+#endif
}
return nullptr;
}
@@ -199,6 +210,11 @@ void ZoomConstraintsClient::RefreshZoomConstraints() {
return;
}
+ // Ignore documents which has been removed from the doc shell.
+ if (!mDocument->IsActive()) {
+ return;
+ }
+
uint32_t presShellId = 0;
ScrollableLayerGuid::ViewID viewId = ScrollableLayerGuid::NULL_SCROLL_ID;
bool scrollIdentifiersValid =