summaryrefslogtreecommitdiffstats
path: root/layout/base/ZoomConstraintsClient.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
commit59203c63bb777a3bacec32fb8830fba33540e809 (patch)
tree58298e711c0ff0575818c30485b44a2f21bf28a0 /layout/base/ZoomConstraintsClient.cpp
parentAdding upstream version 126.0.1. (diff)
downloadfirefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz
firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/base/ZoomConstraintsClient.cpp')
-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 =