Closed Bug 1766082 Opened 4 years ago Closed 4 years ago

Tests cannot be certain that they can get proper screen coordinates

Categories

(Core :: DOM: UI Events & Focus Handling, task, P1)

task

Tracking

()

RESOLVED FIXED
102 Branch
Tracking Status
firefox101 --- fixed
firefox102 --- fixed

People

(Reporter: handyman, Assigned: handyman)

References

Details

Attachments

(2 files)

Generally, the DOM cannot be certain it receives correct screen coordinates. privacy.resistFingerprinting, for example, aligns screen and client coordinates. Additionally, content processes asynchronously get the PBrowser::ChildToParentMatrix and tests will sometimes get bad screen coordinates until the message response is processed -- see bug 1764560.

This design is fine for the browser -- it just looks to JS like the user moved the browser when the message arrived. We could have chosen to have content wait for the transformation before sending screen coordinates but this interpretation of the data suggests we don't need to pay for that delay.

It does pose a problem for (content) tests though. There is no decent way to detect the update with certainty. So we should add a SpecialPowers function to let us know when we can count on that data being valid.

We can reinstate test_bug418986-3.html for Windows-e10s once we have that.

Content processes can provide screen coordinates in e.g. window objects and events without waiting for the proper client-to-screen transforms to be given to them from the parent process. This poses a problem for tests that want to check the screen coordinates, so we add SpecialPowers.ContentTransformsReceived() to allow content processes to wait for these transforms.

Pushed by daparks@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/112793c3b6d7 Allow content to wait for parent screen transforms r=emilio https://hg.mozilla.org/integration/autoland/rev/172227c66f57 Turn on mochitest bug418986-3 for Windows e10s r=emilio
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 102 Branch

Comment on attachment 9273901 [details]
Bug 1766082: Allow content to wait for parent screen transforms r=emilio!

Beta/Release Uplift Approval Request

  • User impact if declined: None (test-only)
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: none
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Test-only code, needed to avoid some intermittents that bug 1767165 would cause otherwise.
  • String changes made/needed: none
  • Is Android affected?: No
Attachment #9273901 - Flags: approval-mozilla-beta?

Comment on attachment 9273901 [details]
Bug 1766082: Allow content to wait for parent screen transforms r=emilio!

Approved for 101.0b3.

Attachment #9273901 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: