Overflow element scrollbar is light for dark mode content.
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Feb 2019 23:34:26 +0000 (23:34 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Feb 2019 23:34:26 +0000 (23:34 +0000)
commit4f30794af7276d5d6e0cfd6d045e0166dcd44869
treefa89d62285a835bbc60a8b7db016bd2caef19d27
parent0507d50c17b7a9e67b17d56bff235381b4f3c951
Overflow element scrollbar is light for dark mode content.
https://bugs.webkit.org/show_bug.cgi?id=194407
rdar://problem/45991585

Reviewed by Beth Dakin.

Source/WebCore:

Tested by css-dark-mode/supported-color-schemes-scrollbar.html.

* page/ChromeClient.h:
(WebCore::FrameView::preferredScrollbarOverlayStyle): Return WTF::nullopt by default to avoid
short-circuiting auto detection in recalculateScrollbarOverlayStyle() for clients, like WK1,
that do not implement preferredScrollbarOverlayStyle().
* page/FrameView.cpp:
(WebCore::FrameView::recalculateScrollbarOverlayStyle): Use WTF::nullopt in the false case
to auto detect overlay style when page() is null.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::useDarkAppearance const): Added.
* rendering/RenderLayer.h:
* testing/Internals.cpp:
(WebCore::Internals::scrollbarOverlayStyle const): Added Node argument.
(WebCore::Internals::scrollbarUsingDarkAppearance const): Added.
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Updated tests to look at overflow elements and if dark apearance
is used by the scrollbar directly.

* css-dark-mode/supported-color-schemes-scrollbar-expected.txt:
* css-dark-mode/supported-color-schemes-scrollbar.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/css-dark-mode/supported-color-schemes-scrollbar-expected.txt
LayoutTests/css-dark-mode/supported-color-schemes-scrollbar.html
Source/WebCore/ChangeLog
Source/WebCore/page/ChromeClient.h
Source/WebCore/page/FrameView.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl