bug: image-masks not expected on rect/quads with view transition live captures
Categories
(Core :: Graphics: WebRender, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox138 | --- | fixed |
People
(Reporter: emilio, Assigned: nical)
References
(Blocks 1 open bug)
Details
(Whiteboard: [viewtransitions:m1:gfx])
Attachments
(2 external files)
See crashes in https://treeherder.mozilla.org/jobs?repo=try&revision=8edee3cecb0ddcd3dd5c3ab6ce1eb4bdd7e3d9d0
| Reporter | ||
Comment 1•1 year ago
|
||
On debug we also see frame time asserts: https://treeherder.mozilla.org/jobs?repo=try&revision=5c5080d805837dc08229eaa3ab3eb8875d4a5b33
But those can be probably removed as per the comments in https://phabricator.services.mozilla.com/D240030
Updated•1 year ago
|
Updated•1 year ago
|
| Assignee | ||
Comment 2•1 year ago
|
||
We are running into this assertion because the display list contains an image-mask clip (in the case of testing/web-platform/tests/css/css-view-transitions/new-content-captures-clip-path.html it's a polygon clip turned into an image for mask so that WR can consume it) that is applied to a rectangle item instead of its parent picture/stacking-context.
Unefortunately the story for how this happens is a bit blurry because of the way clips are specified in the display list: All items are affected by clip chains that define all of the clips up to the root, and during scene building, WR finds all of the clips shared by a picture and its children so that the common part is applied to the picture and only specific clips for each child item is applied to them.
The code that looks for common clips is here.
Looking at testing/web-platform/tests/css/css-view-transitions/new-content-captures-clip-path.html, the polygon clip should be applied to the snapshotted picture instead of the rectangle, but somehow WR fails to deduplicate the clip. I haven't worked out how yet. I suspect that the display list is built in a slightly different way from what WR expects and it throws off the clip extraction.
| Assignee | ||
Comment 3•1 year ago
|
||
Ah I think I found the issue: During scene building I inserted a way to wrap a snapshotted picture into another one to handle some specific filter and shadowing situations, and that seems to be what is throwing off the clip chain deduplicaiton code.
| Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
| Assignee | ||
Comment 4•1 year ago
|
||
The previous behavior was to set the clip chain on the outermost picture and nothing on the wrapped one, but it threw off the shared clip chain determination and caused outer clips to be applied to the children items of the snapshotted stacking context (and in the case of this bug, an image mask clip which we only support on a picture, leading to crashes).
| Assignee | ||
Comment 5•1 year ago
|
||
This patch leverages the common clip extraction optimization happening during scene building to ensure that snapshots are not clipped by ancestor elements as required by the spec.
The snapshotting code was already relying on it but under certain conditions the optimization would not take place.
In addition to the correctness issue, this also more reliably ensures that image masks are only applied to pictures (and not their children items, which would crash) even if the picture is extracted from the traversal of the scene into a snapshot root.
Updated•1 year ago
|
https://hg.mozilla.org/mozilla-central/rev/607d4fa7a748
https://hg.mozilla.org/mozilla-central/rev/f7610eb57ce4
Description
•