Also need to treat a transparent background in dark mode as dark so the scrollbar thumb will be white.
<rdar://problem/46000489>
Need to propagate supported-color-schemes up to the RenderView so it can affect scrollbars.
Created attachment 354605 [details] Patch
Created attachment 354713 [details] Patch
Attachment 354713 [details] did not pass style-queue: ERROR: Source/WebCore/rendering/style/RenderStyle.cpp:962: Line contains only semicolon. If this should be an empty statement, use { } instead. [whitespace/semicolon] [5] Total errors found: 1 in 19 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 354713 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=354713&action=review > Source/WebCore/page/FrameView.cpp:2058 > + auto* document = frame().document(); > + auto* documentElement = document ? document->documentElement() : nullptr; > + auto* documentElementRenderer = documentElement ? documentElement->renderer() : nullptr; > + if (documentElementRenderer && documentElementRenderer->style().hasExplicitlySetSupportedColorSchemes()) > + return documentElementRenderer; > + auto* bodyElement = document ? document->bodyOrFrameset() : nullptr; > + return bodyElement ? bodyElement->renderer() : nullptr; Don't we normally do early returns? A null document would go through 5 extra checks before returning null here. > Source/WebCore/testing/Internals.cpp:2507 > + return "default"_str; First time I've seen someone else use it!
Comment on attachment 354713 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=354713&action=review >> Source/WebCore/page/FrameView.cpp:2058 >> + return bodyElement ? bodyElement->renderer() : nullptr; > > Don't we normally do early returns? A null document would go through 5 extra checks before returning null here. Yes, I could return early for !document. I moved this out of another function, and forgot to change it. >> Source/WebCore/testing/Internals.cpp:2507 >> + return "default"_str; > > First time I've seen someone else use it! Haha.
Comment on attachment 354713 [details] Patch Clearing flags on attachment: 354713 Committed r238155: <https://trac.webkit.org/changeset/238155>
All reviewed patches have been landed. Closing bug.