зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1651050 - Change how the zoomable flag is used in scrollframes. r=tnikkel
If the root scrollframe has the zoomable flag set, it automatically returns true from WantAsyncScroll which makes it the "primary" scrollframe, and automatically gets a displayport. However, this can be undesirable in cases where the root scrollframe is not actually scrollable (i.e. document content doesn't overflow) because we don't actually need that displayport on the root scrollframe and instead want it on a scrollframe that is actually scrollable. This patch removes the behaviour of WantAsyncScroll returning true for such scrollframes, but maintains the layerization changes needed to support zooming. This reduces the set of differences between running with apz.allow_zooming on and off, which in turn eliminates a bunch of test failures when that pref is enabled. Depends on D82777 Differential Revision: https://phabricator.services.mozilla.com/D82778
This commit is contained in:
Родитель
77fbcf18c0
Коммит
aa7d787c6e
|
@ -1442,8 +1442,15 @@ void ScrollFrameHelper::SetScrollableByAPZ(bool aScrollable) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScrollFrameHelper::SetZoomableByAPZ(bool aZoomable) {
|
void ScrollFrameHelper::SetZoomableByAPZ(bool aZoomable) {
|
||||||
|
if (!nsLayoutUtils::UsesAsyncScrolling(mOuter)) {
|
||||||
|
// If APZ is disabled on this window, then we're never actually going to
|
||||||
|
// do any zooming. So we don't need to do any of the setup for it. Note
|
||||||
|
// that this function gets called from ZoomConstraintsClient even if APZ
|
||||||
|
// is disabled to indicate the zoomability of content.
|
||||||
|
aZoomable = false;
|
||||||
|
}
|
||||||
if (mZoomableByAPZ != aZoomable) {
|
if (mZoomableByAPZ != aZoomable) {
|
||||||
// We might be changing the result of WantAsyncScroll() so schedule a
|
// We might be changing the result of DecideScrollableLayer() so schedule a
|
||||||
// paint to make sure we pick up the result of that change.
|
// paint to make sure we pick up the result of that change.
|
||||||
mZoomableByAPZ = aZoomable;
|
mZoomableByAPZ = aZoomable;
|
||||||
mOuter->SchedulePaint();
|
mOuter->SchedulePaint();
|
||||||
|
@ -1455,12 +1462,6 @@ void ScrollFrameHelper::SetHasOutOfFlowContentInsideFilter() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScrollFrameHelper::WantAsyncScroll() const {
|
bool ScrollFrameHelper::WantAsyncScroll() const {
|
||||||
// If zooming is allowed, and this is a frame that's allowed to zoom, then
|
|
||||||
// we want it to be async-scrollable or zooming will not be permitted.
|
|
||||||
if (mZoomableByAPZ) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
ScrollStyles styles = GetScrollStylesFromFrame();
|
ScrollStyles styles = GetScrollStylesFromFrame();
|
||||||
nscoord oneDevPixel =
|
nscoord oneDevPixel =
|
||||||
GetScrolledFrame()->PresContext()->AppUnitsPerDevPixel();
|
GetScrolledFrame()->PresContext()->AppUnitsPerDevPixel();
|
||||||
|
@ -4136,8 +4137,9 @@ bool ScrollFrameHelper::DecideScrollableLayer(
|
||||||
// the compositor can find the scrollable layer for async scrolling.
|
// the compositor can find the scrollable layer for async scrolling.
|
||||||
// If the element is marked 'scrollgrab', also force building of a layer
|
// If the element is marked 'scrollgrab', also force building of a layer
|
||||||
// so that APZ can implement scroll grabbing.
|
// so that APZ can implement scroll grabbing.
|
||||||
mWillBuildScrollableLayer =
|
mWillBuildScrollableLayer = usingDisplayPort ||
|
||||||
usingDisplayPort || nsContentUtils::HasScrollgrab(content);
|
nsContentUtils::HasScrollgrab(content) ||
|
||||||
|
mZoomableByAPZ;
|
||||||
|
|
||||||
// The cached animated geometry root for the display builder is out of
|
// The cached animated geometry root for the display builder is out of
|
||||||
// date if we just introduced a new animated geometry root.
|
// date if we just introduced a new animated geometry root.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче