Find on page selection color isn't adapted for dark mode.
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Jun 2018 22:14:53 +0000 (22:14 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Jun 2018 22:14:53 +0000 (22:14 +0000)
commit1077a12ba838a34be80c9dc8dc2f0649e92f99a3
tree7de1405f183b2ab018df291969fc8e0911d3c3d0
parentcedc0d67ac1089c988cef2a084aba6e453a6c01b
Find on page selection color isn't adapted for dark mode.
https://bugs.webkit.org/show_bug.cgi?id=187072
rdar://problem/40354841

Reviewed by Tim Horton.

Source/WebCore:

* page/mac/TextIndicatorWindow.mm:
(-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]): Use [NSColor findHighlightColor].
* platform/mac/LocalDefaultSystemAppearance.h:
(WebCore::LocalDefaultSystemAppearance::usingDarkAppearance const): Added.
* platform/mac/LocalDefaultSystemAppearance.mm:
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance): Set m_usingDarkAppearance.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintPlatformDocumentMarkers): Use TextPaintPhase::Decoration since this
matches step three of InlineTextBox::paint ("Paint fancy decorations"). This allows TextMatch to
paint a forground and not end up painting during this "fancy decorations" phase.
(WebCore::InlineTextBox::resolveStyleForMarkedText): Set the fillColor for TextMarker to force a
dark text color which will draw over the yellow highlight.
(WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers): Added support for TextPaintPhase::Decoration.
Seperate DocumentMarker::TelephoneNumber and DocumentMarker::TextMatch. Have DocumentMarker::TextMatch
support Forground and Background phases.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::platformColorsDidChange):
(WebCore::RenderTheme::activeTextSearchHighlightColor const): Added. Call the platfrom version.
(WebCore::RenderTheme::inactiveTextSearchHighlightColor const): Added. Ditto.
(WebCore::RenderTheme::platformActiveTextSearchHighlightColor const): Added StyleColor::Options.
(WebCore::RenderTheme::platformInactiveTextSearchHighlightColor const): Ditto.
* rendering/RenderTheme.h:
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::platformActiveTextSearchHighlightColor const): Added.
(WebCore::RenderThemeMac::platformInactiveTextSearchHighlightColor const): Added.
(WebCore::RenderThemeMac::platformColorsDidChange): Clear new color caches.
(WebCore::RenderThemeMac::systemColor const): Cache system colors by light and dark mode.

LayoutTests:

* fast/css/apple-system-control-colors-expected.txt: Updated.
* fast/text/mark-matches-broken-line-rendering-expected.html: Ditto.
* fast/text/mark-matches-rendering-expected.html: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233280 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/apple-system-control-colors-expected.txt
LayoutTests/fast/text/mark-matches-broken-line-rendering-expected.html
LayoutTests/fast/text/mark-matches-rendering-expected.html
Source/WebCore/ChangeLog
Source/WebCore/page/mac/TextIndicatorWindow.mm
Source/WebCore/platform/mac/LocalDefaultSystemAppearance.h
Source/WebCore/platform/mac/LocalDefaultSystemAppearance.mm
Source/WebCore/rendering/InlineTextBox.cpp
Source/WebCore/rendering/RenderTheme.cpp
Source/WebCore/rendering/RenderTheme.h
Source/WebCore/rendering/RenderThemeMac.h
Source/WebCore/rendering/RenderThemeMac.mm