NEW 220225
Wrong background opacity with overflowing divs and fixed position
https://bugs.webkit.org/show_bug.cgi?id=220225
Summary Wrong background opacity with overflowing divs and fixed position
Karel Bilek
Reported 2021-01-02 02:52:52 PST
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)
Attachments
Simple testcase (579 bytes, text/html)
2021-01-02 02:57 PST, Karel Bilek
no flags
Clearer testcase (973 bytes, text/html)
2021-01-05 19:52 PST, Simon Fraser (smfr)
no flags
Karel Bilek
Comment 1 2021-01-02 02:57:16 PST
Created attachment 416894 [details] Simple testcase Simple testcase
Karel Bilek
Comment 2 2021-01-02 02:58:17 PST
I have added an even simpler testcase. Left and right column should be the same, but they are not.
Karel Bilek
Comment 3 2021-01-02 03:02:37 PST
Comment on attachment 416894 [details] Simple testcase It seems the *top* `overflow-x:hidden` is not actually needed to replicate the bug.
Karel Bilek
Comment 4 2021-01-02 03:20:06 PST
Ignore comment 3. The top `overflow-x:hidden` is needed to replicate the bug.
Simon Fraser (smfr)
Comment 5 2021-01-05 19:52:36 PST
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.
Simon Fraser (smfr)
Comment 6 2021-01-05 20:51:50 PST
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.
Radar WebKit Bug Importer
Comment 7 2021-01-09 02:53:11 PST
Note You need to log in before you can comment on or make changes to this bug.