Closed Bug 1725540 Opened 3 years ago Closed 3 years ago

Stop directly accessing `window.top` from OOP iframes in apz_test_native_event_utils.js

Categories

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

defect

Tracking

()

RESOLVED FIXED
93 Branch
Fission Milestone MVP
Tracking Status
firefox-esr78 --- disabled
firefox-esr91 --- disabled
firefox91 --- disabled
firefox92 --- disabled
firefox93 --- fixed

People

(Reporter: hiro, Assigned: hiro)

References

Details

(Whiteboard: fission-soft-blocker)

Attachments

(4 files)

It won't works if it gets called from OOP iframes.

There are three places we need to handle;

The first one can simply use SpecialPowers.spawn(window.top), the rest of the two can't, for instance nested OOP iframes. The rest of the two needs to rewrite with nsIDOMWindowUtils.toScreenRect.

With these changes, most of apz mochitests pass, there are two failures, test_interrupt_reflow.html(bug 1724149) and test_layerization.html. I will file another bug for the latter test.

Here is a try run; https://treeherder.mozilla.org/jobs?repo=try&revision=a76b46aef44051b3ed36af3b9686ec68686d3bf3

A new try run; https://treeherder.mozilla.org/jobs?repo=try&revision=2d64ff84e6e650f05f33a6e919348d4ccfaba355
(I did forget changing a call site of getTargetRect which was renamed to _getTargetRect)

(In reply to Hiroyuki Ikezoe (:hiro) from comment #0)

With these changes, most of apz mochitests pass, there are two failures, test_interrupt_reflow.html(bug 1724149) and test_layerization.html. I will file another bug for the latter test.

Filed bug 1725541.

It's not used.

The test function in helper_touch_action_regions.html needs to run as a
generator function, which means it doesn't work with async/await manners, so
once after we make some utility functions as async, it won't work as expected.
To avoid it, getting the scroller position in the screen coords part needs to
be split out from the generator since the part will be async in the next commit,
and nsIDOMWindowUtils.sendNativeTouchPoint needs to be used directly instead of
using synthesizeNativeTouch since synthesizeNativeTouch will also be async.

Depends on D122557

Thus a bunch of relevant functions need to be async.

Depends on D122558

Severity: -- → S3
Priority: -- → P2

Tracking for Fission Milestone MVP

Fission Milestone: --- → MVP
Whiteboard: fission-soft-blocker
Pushed by hikezoe.birchill@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ad9eb55de057 Drop getTargetOrigin. r=tnikkel https://hg.mozilla.org/integration/autoland/rev/65111930856d Rewrite helper_touch_action_regions.html to make it work with some async utility functions. r=tnikkel https://hg.mozilla.org/integration/autoland/rev/7e795e95ddda Get top level window's resolution via SpecialPowers.spawn. r=tnikkel https://hg.mozilla.org/integration/autoland/rev/575659b876d9 Use nsIDOMWindowUtils.toScreenRect to get positions in the screen coords to avoid accessing window.top directly. r=tnikkel

These patches seem to break running test_layerization.html locally for me on my mac (not fission, not xorigin, just plain). (I pulled them from autoland.) If these patches are applied test_layerization.html fails, if i remove these patches test_layerization.html passes.

I think the coordinate conversion is wrong. When it passes the mouse pointer gets moved over the various scrollable elements. When it fails the mouse cursor is over the browser chrome.

Flags: needinfo?(hikezoe.birchill)
Depends on: 1726638
Regressions: 1726638

Thanks! Filed bug 1726638 for the issue.

Flags: needinfo?(hikezoe.birchill)
Regressions: 1760986
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: