Elements inside a container are rendered on top of the positioned element with the higher z-index
Categories
(Core :: Web Painting, defect, P1)
Tracking
()
People
(Reporter: yuzvik.oleg, Assigned: tnikkel, NeedInfo)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression)
Attachments
(2 files, 1 obsolete file)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Steps to reproduce:
Tried to open a modal dialog (with overlay) by clicking on a button in a web app I am working on
Actual results:
The dialog and overlay were shown but some elements on the page were painted on top of the overlay even though the overlay is positioned and has high z-index set
Expected results:
elements that were painted on top of the overlay should have been painted under the overlay instead
Reporter | ||
Comment 1•1 year ago
|
||
Reporter | ||
Updated•1 year ago
|
![]() |
||
Updated•1 year ago
|
![]() |
||
Updated•1 year ago
|
Comment 2•1 year ago
|
||
:emilio, since you are the author of the regressor, bug 1801123, could you take a look? Also, could you set the severity field?
For more information, please visit BugBot documentation.
Comment 3•1 year ago
|
||
This reproduces also just with contain: paint
, not container-type
in particular.
With a bit more reduced / backward-compatible test-case, I got to this regression range: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=4a692c812a3fe2f893d2a6e25b9490b38415c907&tochange=0969fd6383cea58141d70fbb2d0895ccb476af6c
Unfortunately builds are too old to bisect further and there are a couple suspects (bug 1535507, bug 205202). If I had to guess it'd be the first of those two.
Alice, by any chance, wouldn't you have builds for that range?
Thanks in any case for doing the initial bisection!
Comment 4•1 year ago
|
||
Comment 5•1 year ago
|
||
Ah, bug 1535507 most definitely. Specially given this also reproduces with things like will-change: perspective
and so.
Comment 6•1 year ago
|
||
If I comment out https://searchfox.org/mozilla-central/rev/1e1dc727b9670d7d9117f0622caad387935004c3/layout/painting/RetainedDisplayListBuilder.cpp#78-79 then the bug gets fixed. But not familiar with that code.
Comment 7•1 year ago
|
||
Tim do you know who might be familiar with RDL nowadays?
![]() |
||
Comment 8•1 year ago
|
||
Regression window w/ Test-case without container queries.
:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=365ff23dd4c93ef26743e3fa339b5fac3bf15b66&tochange=2bf6bddf9a8a5c52222273ee787bfca7e6c97394
Comment 9•1 year ago
|
||
Thanks Alice!
As a workaround, adding a no-op transform like scale: 1
or so fixes it (though that's of course not amazing).
Comment 10•1 year ago
|
||
Set release status flags based on info from the regressing bug 1535507
Assignee | ||
Updated•1 year ago
|
Reporter | ||
Comment 11•1 year ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #9)
Thanks Alice!
As a workaround, adding a no-op transform like
scale: 1
or so fixes it (though that's of course not amazing).
Thanks for the workaround, Emilio! I added transform: scale(1,1) (not scale: 1 because it doesn't seem to work in JSX's style property) to the container (outermost element with container-type property set) and the problem is gone.
Updated•1 year ago
|
Comment 12•1 year ago
|
||
Set release status flags based on info from the regressing bug 1535507
Updated•1 year ago
|
Assignee | ||
Comment 13•1 year ago
|
||
I think I know what the problem is, from the commit of the regressing patch:
"If the frame supports it (stacking context + containing block for fixed), and a descendant was
modified, we would have created an override dirty region with just the area of that descendant.
In the case where no descendants are modified, we should use an empty rect, rather than
the area inherited from our parent.
This fixes the case where we forcibly build position:fixed frames (since they might async
scroll differently to the rest of the page), but we only need to build the container item,
not the whole frame subtree within it."
The nsDisplayContainer that contains the contain: paint div here is getting this optimization, it is getting an empty dirty rect on a partial update, which causes us to not build any of its children. The optimization works for fixed pos because we always create a fixed container item in BuildDisplayListForStackingContext. For non-fixed pos we don't always build a nsDisplayContainer, that decision is made here
In this case the list is empty so we don't build anything. Forcing us to build an empty nsDisplayContainer there if we hit the "empty dirty rect" optimization fixes the bug. But I'm not sure if that alone is a landable fix because the logic in WrapInWrapList tries to avoid creating container items if it can, so that might change the display item we get there without marking it modified in a partial update, which we cannot do. I'll think more on this.
Updated•1 year ago
|
Updated•1 year ago
|
Comment 14•11 months ago
|
||
@tnikkel:
- How hard is this to fix?
- Can you prioritize fixing it?
Updated•11 months ago
|
Comment 15•9 months ago
|
||
Keeping this on Tim's radar while he's addressing higher-priority issues.
Assignee | ||
Comment 16•9 months ago
|
||
(In reply to Kelsey Gilbert [:jgilbert] from comment #14)
@tnikkel:
- How hard is this to fix?
Probably not that hard, the next step is in comment 13, I just need to spend some time reading the code and thinking through it.
- Can you prioritize fixing it?
Yes, I definitely want to come back to this and finish it up. I've been treating this as an S3 since this issue was discovered over 4 years after the regressing bug landed, so it's probably not a very common issue. Is the S2 bump coming from bug 1865374 (which this bug blocks)? I'm not sure that bug qualifies for S2.
Comment 17•7 months ago
|
||
Well there is a workaround in comments 9 and 11, so it's probably not dire, but this is still pretty clear-cut rendering correctness issue.
Up to you, but if you're happy with S3 that's fine too.
Updated•7 months ago
|
Comment 18•7 months ago
|
||
Tim, let's evaluate the P1 priority for this one at our next Priority review.
Description
•