This is a defect in the implementation in bug 1528725 due to an oversight on my part. [This code](https://searchfox.org/mozilla-central/source/gfx/layers/apz/src/APZCTreeManager.cpp#2574-2576) 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](https://searchfox.org/mozilla-central/rev/9ee63566281365f26e7a4b06c9d4e2219e64c3e8/gfx/webrender_bindings/src/bindings.rs#2922) 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.
Bug 1542020 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
This is a defect in the implementation in bug 1528725 due to an oversight on my part. [This code](https://searchfox.org/mozilla-central/rev/9ee63566281365f26e7a4b06c9d4e2219e64c3e8/gfx/layers/apz/src/APZCTreeManager.cpp#2574-2576) 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](https://searchfox.org/mozilla-central/rev/9ee63566281365f26e7a4b06c9d4e2219e64c3e8/gfx/webrender_bindings/src/bindings.rs#2922) 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.