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)
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

index a81e298..2a259ef 100644 (file)
@@ -1,3 +1,15 @@
+2018-06-27  Timothy Hatcher  <timothy@apple.com>
+
+        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.
+
+        * 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.
+
 2018-06-27  Youenn Fablet  <youenn@apple.com>
 
         Disable content blockers in NetworkLoadChecker except for ping loads
index bfdf270..3bfcca2 100644 (file)
@@ -12,7 +12,7 @@
 -apple-system-selected-text-background : rgb(181, 213, 255)
 -apple-system-unemphasized-selected-text-background : rgb(212, 212, 212)
 -apple-system-placeholder-text : rgba(0, 0, 0, 0.247059)
--apple-system-find-highlight-background : rgb(255, 255, 0)
+-apple-system-find-highlight-background : rgb(255, 204, 0)
 -apple-system-label : rgba(0, 0, 0, 0.85098)
 -apple-system-secondary-label : rgba(0, 0, 0, 0.498039)
 -apple-system-tertiary-label : rgba(0, 0, 0, 0.247059)
index afd8a57..ab2a818 100644 (file)
@@ -6,7 +6,8 @@ p {
 }
 
 span {
-    background-color: yellow;
+    background-color: rgb(255, 204, 0);
+    color: -apple-system-label;
 }
 </style>
 <p>
index 637ff33..1051793 100644 (file)
@@ -1,3 +1,3 @@
-<p style="display:inline-block; background-color:yellow">
+<p style="display: inline-block; background-color: rgb(255, 204, 0); color: -apple-system-label">
 Quo usque tandem abutere, Catilina, patientia nostra?
 </p>
index 298b127..9187141 100644 (file)
@@ -1,3 +1,40 @@
+2018-06-27  Timothy Hatcher  <timothy@apple.com>
+
+        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.
+
+        * 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.
+
 2018-06-27  Chris Dumez  <cdumez@apple.com>
 
         Crash under SWServer::unregisterServiceWorkerClient()
index 2bb2761..fe332b8 100644 (file)
@@ -34,6 +34,7 @@
 #import "TextIndicator.h"
 #import "WebActionDisablingCALayerDelegate.h"
 #import <pal/spi/cg/CoreGraphicsSPI.h>
+#import <pal/spi/cocoa/NSColorSPI.h>
 #import <pal/spi/cocoa/QuartzCoreSPI.h>
 
 const CFTimeInterval bounceAnimationDuration = 0.12;
@@ -168,7 +169,11 @@ static bool indicatorWantsManualAnimation(const TextIndicator& indicator)
 
     RetainPtr<NSMutableArray> bounceLayers = adoptNS([[NSMutableArray alloc] init]);
 
-    RetainPtr<CGColorRef> highlightColor = [NSColor colorWithDeviceRed:1 green:1 blue:0 alpha:1].CGColor;
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
+    RetainPtr<CGColorRef> highlightColor = [NSColor findHighlightColor].CGColor;
+#else
+    RetainPtr<CGColorRef> highlightColor = [NSColor colorWithDeviceRed:1 green:0.8 blue:0 alpha:1].CGColor;
+#endif
     RetainPtr<CGColorRef> rimShadowColor = [NSColor colorWithDeviceWhite:0 alpha:0.35].CGColor;
     RetainPtr<CGColorRef> dropShadowColor = [NSColor colorWithDeviceWhite:0 alpha:0.2].CGColor;
 
index a1a1845..36c0a62 100644 (file)
@@ -38,12 +38,24 @@ namespace WebCore {
 // functions which call out into AppKit and rely on the current NSAppearance being set
 class LocalDefaultSystemAppearance {
     WTF_MAKE_NONCOPYABLE(LocalDefaultSystemAppearance);
+
 public:
     WEBCORE_EXPORT LocalDefaultSystemAppearance(bool useSystemAppearance, bool useDefaultAppearance);
     WEBCORE_EXPORT ~LocalDefaultSystemAppearance();
+
+    bool usingDarkAppearance() const
+    {
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+        return m_usingDarkAppearance;
+#else
+        return false;
+#endif
+    }
+
 private:
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
     RetainPtr<NSAppearance> m_savedSystemAppearance;
+    bool m_usingDarkAppearance { false };
 #endif
 };
     
index 1aba292..667fbb4 100644 (file)
@@ -42,7 +42,9 @@ LocalDefaultSystemAppearance::LocalDefaultSystemAppearance(bool useSystemAppeara
         return;
 
     m_savedSystemAppearance = [NSAppearance currentAppearance];
-    [NSAppearance setCurrentAppearance:[NSAppearance appearanceNamed:(!useSystemAppearance || useDefaultAppearance ? NSAppearanceNameAqua : NSAppearanceNameDarkAqua)]];
+    m_usingDarkAppearance = useSystemAppearance && !useDefaultAppearance;
+
+    [NSAppearance setCurrentAppearance:[NSAppearance appearanceNamed:m_usingDarkAppearance ? NSAppearanceNameDarkAqua : NSAppearanceNameAqua]];
 #else
     UNUSED_PARAM(useSystemAppearance);
     UNUSED_PARAM(useDefaultAppearance);
index 8910b1b..51f30c4 100644 (file)
@@ -653,7 +653,7 @@ std::pair<unsigned, unsigned> InlineTextBox::selectionStartEnd() const
 
 void InlineTextBox::paintPlatformDocumentMarkers(GraphicsContext& context, const FloatPoint& boxOrigin)
 {
-    for (auto& markedText : subdivide(collectMarkedTextsForDocumentMarkers(TextPaintPhase::Foreground), OverlapStrategy::Frontmost))
+    for (auto& markedText : subdivide(collectMarkedTextsForDocumentMarkers(TextPaintPhase::Decoration), OverlapStrategy::Frontmost))
         paintPlatformDocumentMarker(context, boxOrigin, markedText);
 }
 
@@ -763,10 +763,16 @@ auto InlineTextBox::resolveStyleForMarkedText(const MarkedText& markedText, cons
             style.backgroundColor = { 0xff - selectionBackgroundColor.red(), 0xff - selectionBackgroundColor.green(), 0xff - selectionBackgroundColor.blue() };
         break;
     }
-    case MarkedText::TextMatch:
-        style.backgroundColor = markedText.marker->isActiveMatch() ? renderer().theme().platformActiveTextSearchHighlightColor() : renderer().theme().platformInactiveTextSearchHighlightColor();
+    case MarkedText::TextMatch: {
+        // Text matches always use the light system appearance.
+        OptionSet<StyleColor::Options> styleColorOptions = { StyleColor::Options::UseSystemAppearance, StyleColor::Options::UseDefaultAppearance };
+#if PLATFORM(MAC)
+        style.textStyles.fillColor = renderer().theme().systemColor(CSSValueAppleSystemLabel, styleColorOptions);
+#endif
+        style.backgroundColor = markedText.marker->isActiveMatch() ? renderer().theme().activeTextSearchHighlightColor(styleColorOptions) : renderer().theme().inactiveTextSearchHighlightColor(styleColorOptions);
         break;
     }
+    }
     StyledMarkedText styledMarkedText = markedText;
     styledMarkedText.style = WTFMove(style);
     return styledMarkedText;
@@ -832,7 +838,8 @@ Vector<MarkedText> InlineTextBox::collectMarkedTextsForDraggedContent()
 
 Vector<MarkedText> InlineTextBox::collectMarkedTextsForDocumentMarkers(TextPaintPhase phase)
 {
-    ASSERT(phase == TextPaintPhase::Background || phase == TextPaintPhase::Foreground);
+    ASSERT_ARG(phase, phase == TextPaintPhase::Background || phase == TextPaintPhase::Foreground || phase == TextPaintPhase::Decoration);
+
     if (!renderer().textNode())
         return { };
 
@@ -876,19 +883,23 @@ Vector<MarkedText> InlineTextBox::collectMarkedTextsForDocumentMarkers(TextPaint
         // FIXME: Remove the PLATFORM(IOS)-guard.
         case DocumentMarker::DictationPhraseWithAlternatives:
 #endif
-            if (phase == TextPaintPhase::Background)
+            if (phase != TextPaintPhase::Decoration)
                 continue;
             break;
         case DocumentMarker::TextMatch:
             if (!renderer().frame().editor().markedTextMatchesAreHighlighted())
                 continue;
+            if (phase == TextPaintPhase::Decoration)
+                continue;
+            break;
 #if ENABLE(TELEPHONE_NUMBER_DETECTION)
-            FALLTHROUGH;
         case DocumentMarker::TelephoneNumber:
-#endif
-            if (phase == TextPaintPhase::Foreground)
+            if (!renderer().frame().editor().markedTextMatchesAreHighlighted())
+                continue;
+            if (phase != TextPaintPhase::Background)
                 continue;
             break;
+#endif
         default:
             continue;
         }
index 0988abb..b22ced7 100644 (file)
@@ -1158,6 +1158,9 @@ void RenderTheme::platformColorsDidChange()
     m_activeListBoxSelectionBackgroundColor = Color();
     m_inactiveListBoxSelectionForegroundColor = Color();
 
+    m_activeTextSearchHighlightColor = Color();
+    m_inactiveTextSearchHighlightColor = Color();
+
     Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment();
 }
 
@@ -1283,12 +1286,26 @@ Color RenderTheme::systemColor(CSSValueID cssValueId, OptionSet<StyleColor::Opti
     return Color();
 }
 
-Color RenderTheme::platformActiveTextSearchHighlightColor() const
+Color RenderTheme::activeTextSearchHighlightColor(OptionSet<StyleColor::Options> options) const
+{
+    if (!m_activeTextSearchHighlightColor.isValid())
+        m_activeTextSearchHighlightColor = platformActiveTextSearchHighlightColor(options);
+    return m_activeTextSearchHighlightColor;
+}
+
+Color RenderTheme::inactiveTextSearchHighlightColor(OptionSet<StyleColor::Options> options) const
+{
+    if (!m_inactiveTextSearchHighlightColor.isValid())
+        m_inactiveTextSearchHighlightColor = platformInactiveTextSearchHighlightColor(options);
+    return m_inactiveTextSearchHighlightColor;
+}
+
+Color RenderTheme::platformActiveTextSearchHighlightColor(OptionSet<StyleColor::Options>) const
 {
     return Color(255, 150, 50); // Orange.
 }
 
-Color RenderTheme::platformInactiveTextSearchHighlightColor() const
+Color RenderTheme::platformInactiveTextSearchHighlightColor(OptionSet<StyleColor::Options>) const
 {
     return Color(255, 255, 0); // Yellow.
 }
index 4ad3b59..59134be 100644 (file)
@@ -144,9 +144,9 @@ public:
     Color inactiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options>) const;
     Color inactiveListBoxSelectionForegroundColor(OptionSet<StyleColor::Options>) const;
 
-    // Highlighting colors for TextMatches.
-    virtual Color platformActiveTextSearchHighlightColor() const;
-    virtual Color platformInactiveTextSearchHighlightColor() const;
+    // Highlighting colors for search matches.
+    Color activeTextSearchHighlightColor(OptionSet<StyleColor::Options>) const;
+    Color inactiveTextSearchHighlightColor(OptionSet<StyleColor::Options>) const;
 
     virtual Color disabledTextColor(const Color& textColor, const Color& backgroundColor) const;
 
@@ -265,6 +265,10 @@ protected:
     virtual Color platformActiveListBoxSelectionForegroundColor(OptionSet<StyleColor::Options>) const;
     virtual Color platformInactiveListBoxSelectionForegroundColor(OptionSet<StyleColor::Options>) const;
 
+    // The platform highlighting colors for search matches.
+    virtual Color platformActiveTextSearchHighlightColor(OptionSet<StyleColor::Options>) const;
+    virtual Color platformInactiveTextSearchHighlightColor(OptionSet<StyleColor::Options>) const;
+
     virtual bool supportsSelectionForegroundColors() const { return true; }
     virtual bool supportsListBoxSelectionForegroundColors() const { return true; }
 
@@ -404,6 +408,9 @@ private:
     mutable Color m_inactiveListBoxSelectionBackgroundColor;
     mutable Color m_activeListBoxSelectionForegroundColor;
     mutable Color m_inactiveListBoxSelectionForegroundColor;
+
+    mutable Color m_activeTextSearchHighlightColor;
+    mutable Color m_inactiveTextSearchHighlightColor;
 };
 
 } // namespace WebCore
index 05759b3..a00df42 100644 (file)
@@ -62,6 +62,8 @@ public:
     Color platformInactiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options>) const final;
     Color platformInactiveListBoxSelectionForegroundColor(OptionSet<StyleColor::Options>) const final;
     Color platformFocusRingColor(OptionSet<StyleColor::Options>) const final;
+    Color platformActiveTextSearchHighlightColor(OptionSet<StyleColor::Options>) const final;
+    Color platformInactiveTextSearchHighlightColor(OptionSet<StyleColor::Options>) const final;
 
     ScrollbarControlSize scrollbarControlSizeForPart(ControlPart) final { return SmallScrollbar; }
 
@@ -242,8 +244,10 @@ private:
     bool m_isSliderThumbHorizontalPressed { false };
     bool m_isSliderThumbVerticalPressed { false };
 
-    mutable HashMap<int, Color> m_systemColorCache;
-    mutable Color m_systemVisitedLinkColor;
+    mutable HashMap<int, Color> m_lightSystemColorCache;
+    mutable HashMap<int, Color> m_darkSystemColorCache;
+    mutable Color m_lightSystemVisitedLinkColor;
+    mutable Color m_darkSystemVisitedLinkColor;
 
     RetainPtr<WebCoreRenderThemeNotificationObserver> m_notificationObserver;
 
index 0c881c5..c2b8063 100644 (file)
@@ -391,6 +391,24 @@ Color RenderThemeMac::platformFocusRingColor(OptionSet<StyleColor::Options> opti
     return systemColor(CSSValueWebkitFocusRingColor, options);
 }
 
+Color RenderThemeMac::platformActiveTextSearchHighlightColor(OptionSet<StyleColor::Options> options) const
+{
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
+    LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseSystemAppearance), options.contains(StyleColor::Options::UseDefaultAppearance));
+    return colorFromNSColor([NSColor findHighlightColor]);
+#else
+    UNUSED_PARAM(options);
+    return Color(255, 204, 0); // Yellow.
+#endif
+}
+
+Color RenderThemeMac::platformInactiveTextSearchHighlightColor(OptionSet<StyleColor::Options> options) const
+{
+    // The inactive color is normally used, since no legacy WebKit client marks a text match as active.
+    // So just return the same color for both states.
+    return platformActiveTextSearchHighlightColor(options);
+}
+
 static FontSelectionValue toFontWeight(NSInteger appKitFontWeight)
 {
     ASSERT(appKitFontWeight > 0 && appKitFontWeight < 15);
@@ -486,8 +504,12 @@ static RGBA32 menuBackgroundColor()
 
 void RenderThemeMac::platformColorsDidChange()
 {
-    m_systemColorCache.clear();
-    m_systemVisitedLinkColor = Color();
+    m_lightSystemColorCache.clear();
+    m_darkSystemColorCache.clear();
+
+    m_lightSystemVisitedLinkColor = Color();
+    m_darkSystemVisitedLinkColor = Color();
+
     RenderTheme::platformColorsDidChange();
 }
 
@@ -504,9 +526,15 @@ Color RenderThemeMac::systemColor(CSSValueID cssValueID, OptionSet<StyleColor::O
     if (forVisitedLink && cssValueID == CSSValueWebkitLink) {
         // Only use NSColor when the system appearance is desired, otherwise use RenderTheme's default.
         if (useSystemAppearance) {
-            if (!m_systemVisitedLinkColor.isValid())
-                m_systemVisitedLinkColor = semanticColorFromNSColor([NSColor systemPurpleColor]);
-            return m_systemVisitedLinkColor;
+            if (localAppearance.usingDarkAppearance()) {
+                if (!m_darkSystemVisitedLinkColor.isValid())
+                    m_darkSystemVisitedLinkColor = semanticColorFromNSColor([NSColor systemPurpleColor]);
+                return m_darkSystemVisitedLinkColor;
+            }
+
+            if (!m_lightSystemVisitedLinkColor.isValid())
+                m_lightSystemVisitedLinkColor = semanticColorFromNSColor([NSColor systemPurpleColor]);
+            return m_lightSystemVisitedLinkColor;
         }
 
         return RenderTheme::systemColor(cssValueID, options);
@@ -514,7 +542,8 @@ Color RenderThemeMac::systemColor(CSSValueID cssValueID, OptionSet<StyleColor::O
 
     ASSERT(!forVisitedLink);
 
-    return m_systemColorCache.ensure(cssValueID, [this, cssValueID, useSystemAppearance, options] () -> Color {
+    auto& systemColorCache = localAppearance.usingDarkAppearance() ? m_darkSystemColorCache : m_lightSystemColorCache;
+    return systemColorCache.ensure(cssValueID, [this, cssValueID, useSystemAppearance, options] () -> Color {
         auto selectCocoaColor = [cssValueID, useSystemAppearance] () -> SEL {
             switch (cssValueID) {
             case CSSValueWebkitLink:
@@ -622,7 +651,8 @@ Color RenderThemeMac::systemColor(CSSValueID cssValueID, OptionSet<StyleColor::O
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
                 return @selector(findHighlightColor);
 #else
-                return @selector(systemYellowColor);
+                // Handled below.
+                return nullptr;
 #endif
             case CSSValueAppleSystemLabel:
                 return @selector(labelColor);
@@ -688,6 +718,11 @@ Color RenderThemeMac::systemColor(CSSValueID cssValueID, OptionSet<StyleColor::O
         case CSSValueMenu:
             return menuBackgroundColor();
 
+#if __MAC_OS_X_VERSION_MIN_REQUIRED < 101300
+        case CSSValueAppleSystemFindHighlightBackground:
+            return platformActiveTextSearchHighlightColor(options);
+#endif
+
         case CSSValueAppleSystemEvenAlternatingContentBackground: {
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
             NSArray<NSColor *> *alternateColors = [NSColor alternatingContentBackgroundColors];