RESOLVED FIXED236061
The background of the main frame's transparent custom scrollbar should be filled with the view background color if !HAVE(RUBBER_BANDING)
https://bugs.webkit.org/show_bug.cgi?id=236061
Summary The background of the main frame's transparent custom scrollbar should be fil...
Fujii Hironori
Reported 2022-02-03 00:04:48 PST
Created attachment 450738 [details] test case [WinCairo] transparent scrollbar layer doesn't repaint correctly WinCairo can't render YouTube's custom scrollbar correctly.
Attachments
test case (915 bytes, text/html)
2022-02-03 00:04 PST, Fujii Hironori
no flags
test case (394 bytes, text/html)
2022-07-14 17:53 PDT, Fujii Hironori
no flags
test case (460 bytes, text/html)
2022-07-19 22:04 PDT, Fujii Hironori
no flags
Patch (4.18 KB, patch)
2022-07-19 22:43 PDT, Fujii Hironori
no flags
Patch (6.27 KB, patch)
2022-07-20 20:54 PDT, Fujii Hironori
no flags
Patch (6.31 KB, patch)
2022-07-20 20:57 PDT, Fujii Hironori
no flags
Patch (6.42 KB, patch)
2022-07-20 23:53 PDT, Fujii Hironori
no flags
Patch for landing (6.42 KB, patch)
2022-07-25 14:03 PDT, Fujii Hironori
no flags
Patch for landing (6.50 KB, patch)
2022-07-29 00:10 PDT, Fujii Hironori
no flags
Patch for landing (6.50 KB, patch)
2022-07-29 00:12 PDT, Fujii Hironori
no flags
Patch (6.50 KB, patch)
2022-08-04 18:40 PDT, Fujii Hironori
no flags
[Screenshot] GTK regression (104.78 KB, image/png)
2022-08-07 12:41 PDT, Alice Mikhaylenko
no flags
Patch (6.58 KB, patch)
2022-08-07 17:55 PDT, Fujii Hironori
no flags
Patch (7.26 KB, patch)
2022-08-07 22:23 PDT, Fujii Hironori
no flags
Corner issue screenshot (660.02 KB, image/png)
2022-08-08 15:03 PDT, Alice Mikhaylenko
no flags
Test case patch (8.55 KB, patch)
2022-08-08 15:07 PDT, Alice Mikhaylenko
no flags
Fujii Hironori
Comment 1 2022-07-14 17:53:13 PDT
Created attachment 460919 [details] test case
Fujii Hironori
Comment 2 2022-07-19 00:33:08 PDT
Mac WK2 enables HAVE_RUBBER_BANDING and ENABLE_RUBBER_BANDING, There is m_layerForOverhangAreas layer. Mac WK1 and iOS don't seem to support custom scrollbar.
Fujii Hironori
Comment 3 2022-07-19 17:04:55 PDT
In GTK port, the background of the custom scrollbar is always black, because it clears color buffers with black. It doesn't have the repainting issue because it clears the background for every frames. If I disable it, it also has the same issue with WinCairo. diff --git a/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp b/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp index 57537cf53881..2f133b10e61f 100644 --- a/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp +++ b/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp @@ -234,7 +234,7 @@ void ThreadedCompositor::renderLayerTree() glViewport(0, 0, viewportSize.width(), viewportSize.height()); glClearColor(0, 0, 0, 0); - glClear(GL_COLOR_BUFFER_BIT); + //glClear(GL_COLOR_BUFFER_BIT); m_scene->applyStateChanges(states); m_scene->paintToCurrentGLContext(viewportTransform, FloatRect { FloatPoint { }, viewportSize }, m_paintFlags);
Fujii Hironori
Comment 4 2022-07-19 22:04:23 PDT
Created attachment 461033 [details] test case
Fujii Hironori
Comment 5 2022-07-19 22:07:53 PDT
Fujii Hironori
Comment 6 2022-07-19 22:43:52 PDT
Fujii Hironori
Comment 7 2022-07-20 20:54:04 PDT
Fujii Hironori
Comment 8 2022-07-20 20:57:21 PDT
Fujii Hironori
Comment 9 2022-07-20 23:53:06 PDT
Darin Adler
Comment 10 2022-07-25 10:06:22 PDT
Comment on attachment 461108 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=461108&action=review > Source/WebCore/rendering/RenderLayerCompositor.cpp:3655 > + if (backgroundColor.isValid()) In cases like this, I think it’s good to use isVisible() instead of isValid(). That’s guaranteed to return false for invalid color, but also returns false for fully transparent colors which don’t need painting. On the other hand, maybe fillRect() already does an isVisible() check (I didn’t look). In that case, we don’t need the isValid() check either.
Fujii Hironori
Comment 11 2022-07-25 13:25:57 PDT
Comment on attachment 461108 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=461108&action=review >> Source/WebCore/rendering/RenderLayerCompositor.cpp:3655 >> + if (backgroundColor.isValid()) > > In cases like this, I think it’s good to use isVisible() instead of isValid(). That’s guaranteed to return false for invalid color, but also returns false for fully transparent colors which don’t need painting. > > On the other hand, maybe fillRect() already does an isVisible() check (I didn’t look). In that case, we don’t need the isValid() check either. Color::isVisible doesn't explicitly check Valid flag, but assuming the invalid color has black transparent. So, isVisible returns false for the invalid color. GraphicsContextCG::fillRect doesn't check the invalid color, it fills with black transparent in case of the invalid color.
Darin Adler
Comment 12 2022-07-25 13:32:12 PDT
Comment on attachment 461108 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=461108&action=review >>> Source/WebCore/rendering/RenderLayerCompositor.cpp:3655 >>> + if (backgroundColor.isValid()) >> >> In cases like this, I think it’s good to use isVisible() instead of isValid(). That’s guaranteed to return false for invalid color, but also returns false for fully transparent colors which don’t need painting. >> >> On the other hand, maybe fillRect() already does an isVisible() check (I didn’t look). In that case, we don’t need the isValid() check either. > > Color::isVisible doesn't explicitly check Valid flag, but assuming the invalid color has black transparent. So, isVisible returns false for the invalid color. > > GraphicsContextCG::fillRect doesn't check the invalid color, it fills with black transparent in case of the invalid color. Yes, invalid is guaranteed to also be transparent black. I suggest changing this to isVisible.
Fujii Hironori
Comment 13 2022-07-25 14:03:17 PDT
Created attachment 461202 [details] Patch for landing
EWS
Comment 14 2022-07-25 15:14:40 PDT
Committed 252803@main (386d6b252a24): <https://commits.webkit.org/252803@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 461202 [details].
Radar WebKit Bug Importer
Comment 15 2022-07-25 15:15:18 PDT
Robert Jenner
Comment 16 2022-07-25 17:09:54 PDT
Re-opening for pull request https://github.com/WebKit/WebKit/pull/2352
WebKit Commit Bot
Comment 17 2022-07-28 11:22:17 PDT
Re-opened since this is blocked by bug 243306
Fujii Hironori
Comment 18 2022-07-29 00:10:14 PDT
Created attachment 461289 [details] Patch for landing
Fujii Hironori
Comment 19 2022-07-29 00:12:52 PDT
Created attachment 461290 [details] Patch for landing
Darin Adler
Comment 20 2022-07-29 10:01:27 PDT
Comment on attachment 461290 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=461290&action=review > Source/WebCore/rendering/RenderLayerCompositor.cpp:3660 > +#if HAVE(RUBBER_BANDING) > + UNUSED_PARAM(backgroundColor); > +#else You can’t use an #if for WebKit1 vs. WebKit2, because both share the same underlying WebCore.
Fujii Hironori
Comment 21 2022-08-04 18:36:02 PDT
This patch has no effect for Cocoa ports. EWS reported a test failure for the new test. This is another problem. I fixed it in bug#243422. I'm going to submit the patch for EWS again.
Fujii Hironori
Comment 22 2022-08-04 18:40:27 PDT
EWS
Comment 23 2022-08-05 00:49:27 PDT
Committed 253142@main (a905abaab2bd): <https://commits.webkit.org/253142@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 461411 [details].
Alice Mikhaylenko
Comment 24 2022-08-07 12:40:46 PDT
This regressed GTK overlay scrollbars, they now have a random background.
Alice Mikhaylenko
Comment 25 2022-08-07 12:41:23 PDT
Created attachment 461465 [details] [Screenshot] GTK regression
Fujii Hironori
Comment 26 2022-08-07 12:55:41 PDT
Thank you for reporting. Will revert the change.
Fujii Hironori
Comment 27 2022-08-07 17:55:11 PDT
Fujii Hironori
Comment 28 2022-08-07 22:23:12 PDT
Alice Mikhaylenko
Comment 29 2022-08-08 14:07:59 PDT
FWIW I would like to have this at some point for GTK port for non-overlay scrollbars only. And looking at the patch, this looks like it should already happen with the `scrollbar->isOverlayScrollbar()` check, but doesn't for some reason. No idea why, at least Adwaita scrollbars do properly set it.
Fujii Hironori
Comment 30 2022-08-08 14:11:43 PDT
What do you mean? Do you still have the same problem with the new patch? I tested the patch with GTK MiniBrowser.
Alice Mikhaylenko
Comment 31 2022-08-08 14:14:25 PDT
Oh wait. Sorry, I didn't realize there was a new patch, only saw a revert. 🤦️
Alice Mikhaylenko
Comment 32 2022-08-08 14:43:23 PDT
I can confirm it doesn't break overlay scrollbars. The non-overlay scrollbar variant obscures this background with its own background. If removed it works perfectly, I'll submit that patch in a separate bug once this one is in.
Fujii Hironori
Comment 33 2022-08-08 15:02:28 PDT
Comment on attachment 461474 [details] Patch Thank you very much for testing.
Alice Mikhaylenko
Comment 34 2022-08-08 15:03:44 PDT
Created attachment 461493 [details] Corner issue screenshot Unfortunately I have missed one thing though: it's missing the scrollbar corner, it needs the same color as well. (Sorry for delays, webkit is just taking forever to build on my laptop)
Alice Mikhaylenko
Comment 35 2022-08-08 15:07:55 PDT
Created attachment 461494 [details] Test case patch Here's the patch I used to remove the GTK scrollbar bg to use these colors.
Fujii Hironori
Comment 36 2022-08-08 19:18:55 PDT
I think ScrollbarThemeAdwaita should paint the scrollbar background with the theme color. Why do you want to change the behavior? Does any browsers do so?
Alice Mikhaylenko
Comment 37 2022-08-09 02:11:07 PDT
That scrollbar only has its own background because there was no way to get the page one. It's supposed to blend with the page the same way overlay scrollbars do.
Fujii Hironori
Comment 38 2022-08-09 03:24:06 PDT
Comment on attachment 461474 [details] Patch It seems to be a separate issue which should be filed separately.
EWS
Comment 39 2022-08-09 04:11:07 PDT
Committed 253258@main (dd1137d3994e): <https://commits.webkit.org/253258@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 461474 [details].
Note You need to log in before you can comment on or make changes to this bug.