Rotate clip-path background (CSS) will render outlines of element from ff82
Categories
(Core :: Graphics: WebRender, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr78 | --- | disabled |
firefox-esr102 | --- | wontfix |
firefox-esr115 | --- | wontfix |
firefox81 | --- | wontfix |
firefox82 | --- | wontfix |
firefox83 | --- | wontfix |
firefox84 | --- | wontfix |
firefox85 | --- | wontfix |
firefox86 | --- | wontfix |
firefox117 | --- | wontfix |
firefox118 | --- | wontfix |
firefox119 | --- | verified |
firefox120 | --- | verified |
People
(Reporter: u672315, Assigned: gw)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression)
Attachments
(8 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0
Steps to reproduce:
"Transform rotate" an element with clip-path background, bug appears from FF82beta and in FF83.0a1, see test file and screenshots.
Actual results:
Outlines of element start to show
On FF 81 it is not detected with webrender off.
On FF 82 and 83 with both webrender on or off, if not initially, they will appear when for example the window is "dragged to another size"
Expected results:
Outlines of element should not show
Comment 4•4 years ago
|
||
I can reproduce on Nightly83.0a1 Windows10.
Comment 5•4 years ago
|
||
Regression window(WebRender on):
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=0fedcd9cdd51f06c9e177a1b81c04c7ac93e27bf&tochange=d0221689e8e9a720dca3bdc7f4c3371c09f6626c
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Updated•4 years ago
|
Comment 6•4 years ago
|
||
The severity field is not set for this bug.
:jimm, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•4 years ago
|
Comment 7•4 years ago
|
||
The severity field is not set for this bug.
:jimm, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment hidden (me-too) |
Comment hidden (admin-reviewed) |
Assignee | ||
Comment 10•3 years ago
|
||
(In reply to papoxa8620 from comment #8)
Any news on this one?
The best fix for this will be to ensure that the off-screen surface establishes a raster root, and the image clip mask gets applied in that local space before being drawn in to the parent picture.
The first step of that work is https://bugzilla.mozilla.org/show_bug.cgi?id=1696842 - this ensures that all off-screen surfaces establish a raster root. However, that patch was backed out for causing some unexpected performance regressions, which need further investigation before that can be re-landed.
Comment hidden (me-too) |
Assignee | ||
Comment 13•2 years ago
|
||
All the work to make off-screen surfaces establish raster roots has landed now, so I'll take a look again at this and see why it still happens.
Assignee | ||
Comment 14•2 years ago
|
||
The issue is that the clip-mask is applied in the post-transform space, which is causing accuracy issues (since it's applied on the WR stacking context, not the primitive).
There's a couple of options here:
- Try to be more accurate in handling clip-mask edges when there is a non-axis-aligned transform present.
- Have the clip-mask be applied in the local space of the off-screen surface, so it's axis-aligned with the content it is masking.
(1) is likely to be a smaller change, but difficult to get 100% right - we could probably get it mostly right, but there will still be edge cases that are difficult to get pixel-perfect. (2) is a much better solution, it will give pixel-perfect results, but I'm not sure if this is a complex change to make.
Next step will be to look in to what's involved in option (2) and see how much work would be involved to do this.
Assignee | ||
Comment 15•2 years ago
|
||
A third option:
Make the clip-mask implementation instead be a filter-style property in the WR API. This would implicitly mean the mask is applied in the same local space as the stacking context, prior to the transform being applied.
Updated•2 years ago
|
Comment 16•2 years ago
|
||
Looking at how I can fix this bug, expect some questions and rambles on what I learn :)
Comment 17•2 years ago
|
||
Current plan of attack (per discussion with :gw ) - implement new filter type (Filter::ImageMask) to apply a clip mask in the shader in a better way that won't have this class of rendering artifact.
Rough steps planned so far:
- Prepare a wrench reftests yaml file with help from :gw to test the new filter (done).
- Stub out the new filter case in each place it is used (done).
- Implement the stubs for the filter that are hit in testing.
- Make a list of stubs not hit by any tests, as these may indicate missing test coverage.
- Implement the new filter in the shader code, hooking up a new sampler for the mask.
- Add a config variable for whether to use the new filter type for clip masks and make the code conditional on that.
- Change the way clipmasks are fed to WebRender to use the new filter type (based on the config variable).
- Verify reftests work correctly.
- ?
Comment 22•2 years ago
|
||
The severity field for this bug is relatively low, S4. However, the bug has 5 duplicates.
:ahale, could you consider increasing the bug severity?
For more information, please visit auto_nag documentation.
Comment 23•2 years ago
|
||
Increased severity due to 5 duplicate bugs.
Comment 24•2 years ago
|
||
Putting clipped or masked element in .parent { border-radius: 0.01px; overflow: hidden; }
removes the outline.
Comment 25•2 years ago
|
||
That seems like a novel workaround, my focus however is on making it look right every time without workarounds :)
Status: Nearly looks right with my code changes, but there are polygon gaps between ImageMask tiles at some scroll offsets and zoom levels, so there's something doing some coordinate rounding in the primitive handling that I need to fix.
Comment 26•2 years ago
|
||
(In reply to georg.pukk from comment #24)
Putting clipped or masked element in
.parent { border-radius: 0.01px; overflow: hidden; }
removes the outline.
Thanks for the workaround Georg (psst Ashley I think the workaround was aimed at devs struggling with the bug like me, not you as the assignee).
Comment 27•2 years ago
|
||
(In reply to georg.pukk from comment #24)
Putting clipped or masked element in
.parent { border-radius: 0.01px; overflow: hidden; }
removes the outline.
Seems like you mean to rotate the parent instead. However I found I also needed to add transform: rotate(0deg)
to the child too to hide the artifact.
Comment 28•2 years ago
|
||
(In reply to mfishe from comment #27)
(In reply to georg.pukk from comment #24)
Putting clipped or masked element in
.parent { border-radius: 0.01px; overflow: hidden; }
removes the outline.Seems like you mean to rotate the parent instead. However I found I also needed to add
transform: rotate(0deg)
to the child too to hide the artifact.
For me it works if I rotate the .child itself.
However, it seems that position
other than static
on either element also plays a role.
Comment 29•2 years ago
|
||
(In reply to georg.pukk from comment #28)
(In reply to mfishe from comment #27)
(In reply to georg.pukk from comment #24)
Putting clipped or masked element in
.parent { border-radius: 0.01px; overflow: hidden; }
removes the outline.Seems like you mean to rotate the parent instead. However I found I also needed to add
transform: rotate(0deg)
to the child too to hide the artifact.For me it works if I rotate the .child itself.
However, it seems thatposition
other thanstatic
on either element also plays a role.
Ah yes, you are right. I had position: absolute on the .parent which was what made rotation by 0 necessary on the child.
Comment hidden (me-too) |
Comment hidden (me-too) |
Comment hidden (metoo) |
Comment 34•2 years ago
|
||
For people looking for workarounds:
I managed to avoid this issue by applying {padding: 1px, margin: -1px}
to the element with the clip-path
and box-shadow: 0 0 1px transparent
to the child.
Comment 35•1 years ago
|
||
Reproduction using mask-image and rotate.
Comment 36•1 years ago
|
||
Here's the rendering of attached mask-rotate.html to showcase this bug is not limited to clip-path, but also happens when mask-image
and tranform: rotate
are applied together. Same use case renders without this subpixel "border" in Blink.
Updated•1 years ago
|
Assignee | ||
Comment 37•1 years ago
|
||
One the work in https://bugzilla.mozilla.org/show_bug.cgi?id=1823579 is complete, we should be in a much better position to fix this case. That work should be complete in the next 2-3 weeks.
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 38•1 year ago
|
||
Both the repro in comment #1 and comment #36 appear fixed for me with the patches in #1849530 and #1849661 applied. There is a try build with these at [1] if anyone wants to do some local testing, build artifacts should be available soon.
I think there are still some other edge cases that can cause this to occur, but I will fix those if / when they are reported as separate bugs, which should be much simpler after the work done to fix this most common case.
[1] https://treeherder.mozilla.org/jobs?repo=try&revision=9d9c1d8c2dd5fbcc45726bb0afb9e5b04c8de5a9
Comment 40•1 year ago
•
|
||
With the latest nightly (that contains the fix from bug 1849661), I can still repro the dotted lines on the first testcase by pinch-zooming and maybe panning on the image. It may also be dependent on some parts of the zoomed-out testcase being beyond the visible part of the page.
:gw, let me know if you want this to be tracked in a new bug.
Edit2: The second testcase also renders the dotted line with pinch-zoom and maybe some panning.
Comment 41•1 year ago
|
||
Assignee | ||
Comment 42•1 year ago
•
|
||
Yes, let's track that in a separate bug - I know what the cause is, and it's a different issue than what was resolved in this bug.
Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
Comment 43•1 year ago
|
||
(In reply to Glenn Watson [:gw] from comment #42)
Yes, let's track that in a separate bug - I know what the cause is, and it's a different issue than what was resolved in this bug.
Filed bug 1850869
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Reproducible on a 2023-08-24 Nightly build on Windows 10.
Verified as fixed on Firefox 119.0b2(build ID: 20230928191344) and Nightly 120.0a1(build ID: 20230928215127) on Windows 10, macOS 12, Ubuntu 22.
Updated•1 year ago
|
Updated•1 year ago
|
Description
•