UNCONFIRMED 65906
In RenderBox::paintBoxDecorations, there is bug in cairo-port because of newly added endTransparencyLayer code.
https://bugs.webkit.org/show_bug.cgi?id=65906
Summary In RenderBox::paintBoxDecorations, there is bug in cairo-port because of newl...
KyungTae Kim
Reported 2011-08-09 03:44:56 PDT
In RenderBox::paintBoxDecorations in WebCore/rendering/RenderBox.cpp, there are newly added code to avoid the background color bleeding out behind the border. In there, the beginTransparencyLayer/endTransparencyLayer are used for clipping the background and border. But in cairo port, when drawing box with minus position, an error is occured during cairo_paint_with_alpha in endTransparencyLayer. I think TransparencyLayer is for combining to apply alpha for two or more objects, not for combining to apply clip. I think not using beginTransparencyLayer/endTransparencyLayer in there can do the same thing more efficiently. If there is some reasons for using beginTransparencyLayer/endTransparencyLayer except for the clipping, please let me know. Thank you.
Attachments
Patch for EWS (1.33 KB, patch)
2022-07-20 18:05 PDT, Fujii Hironori
no flags
screenshots of fast/borders/borderRadiusDashed01.html with/without beginTransparencyLayer (1.53 MB, image/png)
2022-07-21 13:32 PDT, Fujii Hironori
no flags
Simon Fraser (smfr)
Comment 1 2011-08-09 08:29:20 PDT
The transparency layer is used to ensure that there is no bleed of the background color outside the border. It sounds like this is just a bug in the Cairo port.
Fujii Hironori
Comment 2 2022-07-20 17:21:49 PDT
I think it's technically possible to ensure the background doesn't bleed outside of the borders without beginTransparencyLayer, but just with clipRoundedRect and painting borders 1px bolder to outside.
Fujii Hironori
Comment 3 2022-07-20 18:05:09 PDT
Created attachment 461065 [details] Patch for EWS This patch just removes beginTransparencyLayer. Will check how many tests fail.
Fujii Hironori
Comment 4 2022-07-21 00:00:42 PDT
EWS reported no test failures. We have no reason not to remove the beginTransparencyLayer.
Fujii Hironori
Comment 5 2022-07-21 00:17:15 PDT
bug#21819 added BackgroundBleedUseTransparencyLayer. It added pixel tests. EWS doesn't run pixel tests.
Fujii Hironori
Comment 6 2022-07-21 05:08:47 PDT
I compiled Mac port with applying the patch (attachment#461065 [details]), and tested with test cases (attachment#24582 [details], attachment#30051 [details], and attachment#56341 [details]). But, I observed no problem. Can I remove the beginTransparencyLayer?
Simon Fraser (smfr)
Comment 7 2022-07-21 10:10:01 PDT
None of those examples hit this code path.
Simon Fraser (smfr)
Comment 8 2022-07-21 10:17:15 PDT
fast/borders/borderRadiusDashed01.html hits this code (and without the transparency layer you see some green pixels outside the red border).
Fujii Hironori
Comment 9 2022-07-21 13:32:31 PDT
Created attachment 461120 [details] screenshots of fast/borders/borderRadiusDashed01.html with/without beginTransparencyLayer Thank you.
Fujii Hironori
Comment 10 2022-07-21 13:33:04 PDT
Blink just removed beginTransparencyLayer. Issue 165213005: Avoid using transparency layer for fancy borders. - Code Review https://codereview.chromium.org/165213005/#ps110001 Avoid using transparency layer for fancy borders. · chromium/chromium@3164524 https://github.com/chromium/chromium/commit/316452432e4fe5e0ca4dcc12149e5fcfc75d6f03
Note You need to log in before you can comment on or make changes to this bug.