Hit-testing produces incorrect result with clip-path over iframe element
Categories
(Core :: Panning and Zooming, defect, P3)
Tracking
()
People
(Reporter: kats, Assigned: kats)
References
Details
Attachments
(3 files)
(deleted),
text/html
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
Bug 1543482 - Add the irregular-area flag for frames with masks and clip paths. r?mattwoodrow,botond
(deleted),
text/x-phabricator-request
|
Details |
STR:
- load attached file
- move mouse to over the blue area
- scroll with wheel/trackpad
Expected:
- iframe scrolls (blue rect will move)
Actual:
- root document scrolls, mostly. sometimes on first load it will scroll the iframe.
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 1•6 years ago
|
||
When the scrollframe for the iframe is inactive, we do a main-thread hit-test and it produces the right result. Once the scrollframe is activated, there is a hit-region in the layer tree for the bounding box of the clipped element, and so APZ always hits the wrong thing without waiting for the main thread.
As far as I can tell this has been broken since the original event regions code landed, which probably means that this scenario isn't exercised very much in the wild.
Assignee | ||
Comment 2•6 years ago
|
||
Also the testcase works correctly when WR is enabled, because we add the eIrregularArea flag for the clip-path element here which forces APZ to do main-thread lookup.
Assignee | ||
Comment 3•6 years ago
|
||
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #2)
Also the testcase works correctly when WR is enabled, because we add the eIrregularArea flag for the clip-path element here which forces APZ to do main-thread lookup.
That's not true. The testcase does work correctly for WR, but it's because clip-path gets turned into an nsDisplayMasksAndClipPath item which goes directly into a WR clip item, and so WR can do precise hit-testing against it.
The eIrregularArea thing only happens for SVGs, so I should probably write a separate testcase for that.
Assignee | ||
Comment 4•6 years ago
|
||
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #3)
That's not true. The testcase does work correctly for WR, but it's because clip-path gets turned into an nsDisplayMasksAndClipPath item which goes directly into a WR clip item, and so WR can do precise hit-testing against it.
Sadly, that's also not true. Only some nsDisplayMasksAndClipPath items (simple shapes) get precisely hit-tested. Anything that ends up as a mask clip looks like it gets turned into a bounding box here in WR and so we'll actually get incorrect results from WR in that case. The testcase I posted is a simple shape and so it works fine.
Assignee | ||
Comment 5•6 years ago
|
||
Assignee | ||
Comment 6•6 years ago
|
||
Assignee | ||
Comment 7•6 years ago
|
||
This will force APZ to do a main-thread hit-test for the cases where the
shapes are too complex to easily send to the compositor.
Depends on D27454
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 8•6 years ago
|
||
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #3)
The eIrregularArea thing only happens for SVGs, so I should probably write a separate testcase for that.
Filed bug 1544451 for that.
Comment 10•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7d9507696389
https://hg.mozilla.org/mozilla-central/rev/7d6cd4e20705
Assignee | ||
Comment 11•6 years ago
|
||
I don't think there's a pressing need to uplift this. It's a correctness improvement but not one we've run into in the wild.
Description
•