Closed Bug 1542020 Opened 5 years ago Closed 3 years ago

APZ can stamp input events with the wrong layers id

Categories

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

defect

Tracking

()

RESOLVED DUPLICATE of bug 1541589
Fission Milestone M7

People

(Reporter: kats, Unassigned)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [apz:fission:3:S])

This is a defect in the implementation in bug 1528725 due to an oversight on my part. This code added in bug 1528725 assumes that the hit-test result returned from WebRender is always 100% unambiguously correct. In fact, in some cases (e.g. OOP iframes intersecting SVG or clip-path'd elements), the hitInfo field returned from WR might have the eDispatchToContent flag set, in which case the layers id might not actually be correct. In such a case, APZ might stamp the input event with the wrong layers id.

To correct this, we need to update the WR hit-test to not just take the topmost result but iterate through all the results. If all the results have the same pipeline id, then that's good and we can stamp the input events with that. If the results have multiple pipeline ids, and any of the results have an eDispatchToContent flag set, then the result is ambiguous, and we need to do a main-thread fallback (which is covered by bug 1541589).

To minimize the perf impact of the above, we should also make sure that the eDispatchToContent flag is only ever set to indicate ambiguous hit-test areas. Currently it also used to indicate areas with APZ-aware event listeners. I've filed bug 1542019 to track this work.

I wrote a testcase to demonstrate this behaviour, and it seems to fail even without WR/Fission. I filed bug 1543482 for it; the testcase is on that bug.

See Also: → 1543482

The testcase on bug 1543482 has been broken pretty much since the original implementation, but it only affected async-scrolling the right scrollframe. In case of incorrect result, the user probably could work around it.

For this bug we probably have stricter requirements because it affects all events (e.g. mousemove events) and they could get delivered to the wrong content process, which could have harder-to-work-around consequences.

This will need bug 1541589 in order to be fixed completely, adding a dependency.

No longer blocks: 1625249

The patches that landed in bug 1566599 are a code dependency here, as they move the looping over WR results from Rust to C++ code, which allows doing the iteration I described in comment 0.

Depends on: 1566599
See Also: 1566599
Fission Milestone: --- → M7
Whiteboard: [apz:fission:3:S]

btw, we plan to allow Fission on macOS and Linux without WR (and may need to support Fission on Windows without WR), so we will want to test APZ bugs both with and without WR.

I'm going to dupe this over to bug 1541589 because it doesn't serve any additional purpose.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.