Closed Bug 1691358 Opened 4 years ago Closed 3 years ago

Desktop zoom value is doubled (or incorrect) in BrowserChild::mChildToParentConversionMatrix after PresShell::SetResolution call until layers get updated or RequestContentRepaint happens

Categories

(Core :: Panning and Zooming, defect)

defect

Tracking

()

RESOLVED FIXED
93 Branch
Tracking Status
firefox93 --- fixed

People

(Reporter: hiro, Assigned: hiro)

References

Details

Attachments

(1 file)

During writing mochitest (with nsIDOMWindowUtils.setResolutionAndScaleTo) for bug 1684795, I noticed this issue.

What I wrote initially is calling setResolutionAndScaleTo after the target iframe has been loaded, then calling a pair of promiseApzFlushedRepaints() and waitUntilApzStable(), but with this setup, I couldn't get the correct result via BrowserChild::mChildToParentConversionMatrix.

When we compute the transform matrix, we call HitTestingTreeNode::GetTransformToGecko which calls AsyncPanZoomController::GetTransformToLastDispatchedPaint and in the function we do compare mExpectedGeckoMatrix.GetZoom() and mLastContentPaintMetric.GetZoom(), the code is;

    zoomChange = lastContentZoom / lastDispatchedZoom;

So, for example, if there is a SetResolution call with 2.0, then the zoomChange will be 2.0, then it will be cumulated with mTransform value in HitTestingTreeNode::GetTransformToGecko.

I'm happy to investigate this a bit, but I'm unclear on how to repro it at the moment. Hiro, you mentioned a patch to browser_test_select_popup_position.js which I applied -- should I be seeing a problematic TransformToGecko when running the test?

Yeah, I think it should happen by running the test with --enable-fission option.

Also, the patch adds a setTimeout call so that during opening the content in question, you can click the <select> element to see where the popup window is shown.

See Also: → 1719406

I think I may have run into this again in bug 1719406.

Do you mean that bug 1719406 fixes this?

I kinda think so, this bug sounds very very similar to what I was seeing, but I didn't test the original reproduction of this bug to be sure.

Hiro, are you able to confirm whether this has been fixed?

Flags: needinfo?(hikezoe.birchill)

Yep, it's been fixed. I am going to re-use this bug to add a test.

A try run with the test; https://treeherder.mozilla.org/jobs?repo=try&revision=a16d46a428426fcadf5729f3d085f254d87ba643

Assignee: nobody → hikezoe.birchill
Status: NEW → ASSIGNED
Depends on: 1719406
Flags: needinfo?(hikezoe.birchill)
Pushed by hikezoe.birchill@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2997688aff64 Add a test to make sure nsIDOMWindowUtils.setResolutionAndScaleTo properly delivered to OOP iframes. r=botond
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: