| Summary: | Wrong background opacity with overflowing divs and fixed position | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Karel Bilek <kb> | ||||||
| Component: | Compositing | Assignee: | Simon Fraser (smfr) <simon.fraser> | ||||||
| Status: | NEW --- | ||||||||
| Severity: | Normal | CC: | simon.fraser, webkit-bug-importer, zalan | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | Safari Technology Preview | ||||||||
| Hardware: | Mac (Intel) | ||||||||
| OS: | macOS 11 | ||||||||
| Attachments: |
|
||||||||
Created attachment 416894 [details]
Simple testcase
Simple testcase
I have added an even simpler testcase. Left and right column should be the same, but they are not. Comment on attachment 416894 [details]
Simple testcase
It seems the *top* `overflow-x:hidden` is not actually needed to replicate the bug.
Ignore comment 3. The top `overflow-x:hidden` is needed to replicate the bug. Created attachment 417064 [details]
Clearer testcase
This is about "simple container" layers. We set the alpha color both as layer background color, and also paint it into a sublayer.
Adding border, box-shadow or contents to the outer element makes the bug not happen.
RenderLayerBacking::updateDrawsContent() calls m_graphicsLayer->setDrawsContent(hasNonScrollingPaintedContent) but that ignores that fact that we've already determined that the content is a simple background color. |
I caught a bug with this minimal replication code. ``` <div style="width:100%;height: 100%; position: fixed; overflow-x:hidden; background-color: rgba(0,0,0,0.5);"> <div style="overflow-x: hidden;height: 18000px;width: 100px; background-color: white"> <div style="height: 20000px;"> </div> </div> </div> ``` When the inner div is bigger than the middle div, the background opacity of the top div is wrong. (20000px > 18000px) When I change 20000 to 10000, the opacity is correct. I have tried this in Chrome and Firefox and it does not happen there, so it must be a webkit bug. I don't see Big Sur in build archives so I cannot try this there; I use Safari Technology Preview, Release 117 (Safari 14.1, WebKit 16611.1.7.2)