Closed Bug 1702859 Opened 3 years ago Closed 2 years ago

subframe scroll thumbs mispositioned with pinch zoom + webrender

Categories

(Core :: Panning and Zooming, defect, P2)

defect

Tracking

()

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: tnikkel, Assigned: botond)

References

(Blocks 2 open bugs)

Details

Attachments

(8 files)

Attached file posh3.html

The async transform is most likely the source of the problem.

I checked older builds, the problem seems to exist as far back as I can reasonably test, before that desktop zooming isn't in good enough shape to test it seems.

Here's one example of the problem, I can scroll the thumbs all the way out of view.

Severity: -- → S3
Priority: -- → P3

Raising priority as we are seeing users notice this.

Priority: P3 → P2

The work we did with "transform to ancestor" (bug 1732600 and related), mostly the new understandings we got about how resolution works with webrender vs layers, might make this easier to debug/understand.

The async transform of the scrollbars appears to be off by a factor equal to the resolution.

I believe what's happening here is that ComputeTransformForScrollThumb() is computing a transform in the scrollbar's "layer space", that is, a coordinate space such that one unit of translation moves the scrollbar by one rendered pixel.

With Layers, this transform was used as the scrollbar layer's shadow transform. The scrollbar layer was also subject to the shadow transforms of ancestor layers, which in the case of a subframe scrollbar included the zoom container layer. However, the zoom container layer's effective transform scale was 1.0 (the zoom was cancelled out by a pre-scale, to reflect the fact that the zoom container's descendants are already rendered at a higher resolution to account for the zoom).

With WebRender, this transform is used as a transform property associated with the scrollbar's animation id. In this usage, subframe scrollbars are also subject to the zoom transform, but this time there is no pre-scale to cancel that out.

Therefore, for subframe scrollbars, the values expected by Layers and WebRender in this computed transform differ by a factor equal to the zoom level.

Assignee: nobody → botond

These already pass, just adding them for test coverage.

Depends on D130535

For these tests, the reference file also has the resolution (otherwise
the subframe scrollbar thicknesses wouldn't match), the only difference
is async scroll vs. sync scroll.

These tests fail without the fix for this bug.

Depends on D130536

The computation included the resolution of enclosing scroll frames
in the scrollbar transform. This was correct with Layers (where
the resolution was "pushed down" to descendant layers such that
their layer space represented rendered pixels) but incorrect with
WebRender (where items with transform properties like a subframe
scrollbar are still subject to enclosing transform properties like
the zoom).

This makes the reftests added in the previous patch pass.

Depends on D130537

Pushed by bballo@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/eeea103db0ee
Add a comment explaining why async-scrollbar-zoom-{1,2}.html are not enabled on desktop yet. r=tnikkel
https://hg.mozilla.org/integration/autoland/rev/9fd7371a4616
Make APZ scrollbar reftest names more descriptive and more consistent. r=tnikkel
https://hg.mozilla.org/integration/autoland/rev/448061f3c607
Add async scrolling versions of the zoomed root scrollbar tests. r=tnikkel
https://hg.mozilla.org/integration/autoland/rev/eaa080c9e238
Add subframe versions of the zoomed scrollbar async scroll tests. r=tnikkel
https://hg.mozilla.org/integration/autoland/rev/3bb9cf3fa215
Fix async transform computation for subframe scrollbars. r=tnikkel
https://hg.mozilla.org/integration/autoland/rev/254807479c9d
Tweak fuzz values for new tests. r=tnikkel

(In reply to Botond Ballo [:botond] from comment #7)

I believe what's happening here is that ComputeTransformForScrollThumb() is computing a transform in the scrollbar's "layer space", that is, a coordinate space such that one unit of translation moves the scrollbar by one rendered pixel.

With Layers, this transform was used as the scrollbar layer's shadow transform. The scrollbar layer was also subject to the shadow transforms of ancestor layers, which in the case of a subframe scrollbar included the zoom container layer. However, the zoom container layer's effective transform scale was 1.0 (the zoom was cancelled out by a pre-scale, to reflect the fact that the zoom container's descendants are already rendered at a higher resolution to account for the zoom).

With WebRender, this transform is used as a transform property associated with the scrollbar's animation id. In this usage, subframe scrollbars are also subject to the zoom transform, but this time there is no pre-scale to cancel that out.

Therefore, for subframe scrollbars, the values expected by Layers and WebRender in this computed transform differ by a factor equal to the zoom level.

I missed this comment when reviewing, it would have been helpful! I need to remind myself to check the bug.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: