Title: [291950] trunk
Revision
291950
Author
[email protected]
Date
2022-03-27 04:53:41 -0700 (Sun, 27 Mar 2022)

Log Message

[GTK][WPE] Support CSS accent-color
https://bugs.webkit.org/show_bug.cgi?id=238398

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Add accent-color support for progress, range and entries.
Update check and radio styles so that they can use accent color as well.

* platform/adwaita/ThemeAdwaita.cpp:
(WebCore::ThemeAdwaita::paint):
(WebCore::ThemeAdwaita::paintCheckbox):
(WebCore::ThemeAdwaita::paintRadio):
* platform/adwaita/ThemeAdwaita.h:
* rendering/RenderThemeAdwaita.cpp:
(WebCore::getSystemAccentColor):
(WebCore::getAccentColor):
(WebCore::RenderThemeAdwaita::platformActiveSelectionBackgroundColor const):
(WebCore::RenderThemeAdwaita::paintTextField):
(WebCore::RenderThemeAdwaita::paintProgressBar):
(WebCore::RenderThemeAdwaita::paintSliderTrack):
(WebCore::RenderThemeAdwaita::paintSliderThumb):

Source/WTF:

* Scripts/Preferences/WebPreferencesExperimental.yaml: Enable accent-color for GTK and WPE.

LayoutTests:

* platform/gtk/TestExpectations: Enable accent-color tests for GTK.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (291949 => 291950)


--- trunk/LayoutTests/ChangeLog	2022-03-27 06:33:17 UTC (rev 291949)
+++ trunk/LayoutTests/ChangeLog	2022-03-27 11:53:41 UTC (rev 291950)
@@ -1,3 +1,12 @@
+2022-03-27  Alexander Mikhaylenko  <[email protected]>
+
+        [GTK][WPE] Support CSS accent-color
+        https://bugs.webkit.org/show_bug.cgi?id=238398
+
+        Reviewed by Carlos Garcia Campos.
+
+        * platform/gtk/TestExpectations: Enable accent-color tests for GTK.
+
 2022-03-26  Noam Rosenthal  <[email protected]>
 
         Import clip-path W3C tests

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (291949 => 291950)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2022-03-27 06:33:17 UTC (rev 291949)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2022-03-27 11:53:41 UTC (rev 291950)
@@ -31,6 +31,13 @@
 imported/w3c/web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-02.html [ Pass ]
 imported/w3c/web-platform-tests/html/semantics/embedded-content/the-area-element/area-coords.html [ Pass ]
 
+fast/css/accent-color/checkbox.html [ Pass ]
+fast/css/accent-color/progress.html [ Pass ]
+fast/css/accent-color/radio.html [ Pass ]
+fast/css/accent-color/range.html [ Pass ]
+fast/css/accent-color/text.html [ Pass ]
+imported/w3c/web-platform-tests/css/css-ui/accent-color-checkbox-checked-001.tentative.html [ Pass ]
+
 # Some Apple ports don't support RTL scrollbars.
 fast/scrolling/rtl-scrollbars-alternate-body-dir-attr-does-not-update-scrollbar-placement.html [ Pass ]
 fast/scrolling/rtl-scrollbars-iframe-scrolled.html [ Pass ]

Modified: trunk/Source/WTF/ChangeLog (291949 => 291950)


--- trunk/Source/WTF/ChangeLog	2022-03-27 06:33:17 UTC (rev 291949)
+++ trunk/Source/WTF/ChangeLog	2022-03-27 11:53:41 UTC (rev 291950)
@@ -1,3 +1,12 @@
+2022-03-27  Alexander Mikhaylenko  <[email protected]>
+
+        [GTK][WPE] Support CSS accent-color
+        https://bugs.webkit.org/show_bug.cgi?id=238398
+
+        Reviewed by Carlos Garcia Campos.
+
+        * Scripts/Preferences/WebPreferencesExperimental.yaml: Enable accent-color for GTK and WPE.
+
 2022-03-26  Yusuke Suzuki  <[email protected]>
 
         Use static_assert instead of COMPILE_ASSERT

Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml (291949 => 291950)


--- trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml	2022-03-27 06:33:17 UTC (rev 291949)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml	2022-03-27 11:53:41 UTC (rev 291950)
@@ -35,10 +35,10 @@
       "PLATFORM(COCOA)" : true
       default: false
     WebKit:
-      "PLATFORM(COCOA)" : true
+      "PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE)": true
       default: false
     WebCore:
-      "PLATFORM(COCOA)" : true
+      "PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE)": true
       default: false
 
 AccessHandleEnabled:

Modified: trunk/Source/WebCore/ChangeLog (291949 => 291950)


--- trunk/Source/WebCore/ChangeLog	2022-03-27 06:33:17 UTC (rev 291949)
+++ trunk/Source/WebCore/ChangeLog	2022-03-27 11:53:41 UTC (rev 291950)
@@ -1,3 +1,27 @@
+2022-03-27  Alexander Mikhaylenko  <[email protected]>
+
+        [GTK][WPE] Support CSS accent-color
+        https://bugs.webkit.org/show_bug.cgi?id=238398
+
+        Reviewed by Carlos Garcia Campos.
+
+        Add accent-color support for progress, range and entries.
+        Update check and radio styles so that they can use accent color as well.
+
+        * platform/adwaita/ThemeAdwaita.cpp:
+        (WebCore::ThemeAdwaita::paint):
+        (WebCore::ThemeAdwaita::paintCheckbox):
+        (WebCore::ThemeAdwaita::paintRadio):
+        * platform/adwaita/ThemeAdwaita.h:
+        * rendering/RenderThemeAdwaita.cpp:
+        (WebCore::getSystemAccentColor):
+        (WebCore::getAccentColor):
+        (WebCore::RenderThemeAdwaita::platformActiveSelectionBackgroundColor const):
+        (WebCore::RenderThemeAdwaita::paintTextField):
+        (WebCore::RenderThemeAdwaita::paintProgressBar):
+        (WebCore::RenderThemeAdwaita::paintSliderTrack):
+        (WebCore::RenderThemeAdwaita::paintSliderThumb):
+
 2022-03-26  Yusuke Suzuki  <[email protected]>
 
         Use static_assert instead of COMPILE_ASSERT

Modified: trunk/Source/WebCore/platform/adwaita/ThemeAdwaita.cpp (291949 => 291950)


--- trunk/Source/WebCore/platform/adwaita/ThemeAdwaita.cpp	2022-03-27 06:33:17 UTC (rev 291949)
+++ trunk/Source/WebCore/platform/adwaita/ThemeAdwaita.cpp	2022-03-27 11:53:41 UTC (rev 291950)
@@ -27,6 +27,7 @@
 #include "ThemeAdwaita.h"
 
 #include "Color.h"
+#include "ColorBlending.h"
 #include "ControlStates.h"
 #include "FloatRoundedRect.h"
 #include "GraphicsContext.h"
@@ -50,26 +51,25 @@
 static constexpr auto buttonBackgroundColorLight = SRGBA<uint8_t> { 244, 244, 244 };
 static constexpr auto buttonBackgroundPressedColorLight = SRGBA<uint8_t> { 214, 214, 214 };
 static constexpr auto buttonBackgroundHoveredColorLight = SRGBA<uint8_t> { 248, 248, 248 };
-static constexpr auto toggleBackgroundColorLight = Color::white;
-static constexpr auto toggleBackgroundHoveredColorLight = SRGBA<uint8_t> { 214, 214, 214 };
+static constexpr auto toggleBorderColorLight = SRGBA<uint8_t> { 0, 0, 0, 50 };
+static constexpr auto toggleBorderHoveredColorLight = SRGBA<uint8_t> { 0, 0, 0, 80 };
 
 static constexpr auto buttonBorderColorDark = SRGBA<uint8_t> { 255, 255, 255, 50 };
 static constexpr auto buttonBackgroundColorDark = SRGBA<uint8_t> { 52, 52, 52 };
 static constexpr auto buttonBackgroundPressedColorDark = SRGBA<uint8_t> { 30, 30, 30 };
 static constexpr auto buttonBackgroundHoveredColorDark = SRGBA<uint8_t> { 60, 60, 60 };
-static constexpr auto toggleBackgroundColorDark = SRGBA<uint8_t> { 45, 45, 45 };
-static constexpr auto toggleBackgroundHoveredColorDark = SRGBA<uint8_t> { 60, 60, 60 };
+static constexpr auto toggleBorderColorDark = SRGBA<uint8_t> { 255, 255, 255, 50 };
+static constexpr auto toggleBorderHoveredColorDark = SRGBA<uint8_t> { 255, 255, 255, 80 };
 
 static const double toggleSize = 14.;
+static const int toggleBorderSize = 2;
 static const int toggleFocusOffset = 2;
 
-static constexpr auto toggleColorLight = SRGBA<uint8_t> { 0, 0, 0, 200 };
 static constexpr auto spinButtonBorderColorLight = SRGBA<uint8_t> { 0, 0, 0, 25 };
 static constexpr auto spinButtonBackgroundColorLight = Color::white;
 static constexpr auto spinButtonBackgroundHoveredColorLight = SRGBA<uint8_t> { 0, 0, 0, 50 };
 static constexpr auto spinButtonBackgroundPressedColorLight = SRGBA<uint8_t> { 0, 0, 0, 70 };
 
-static constexpr auto toggleColorDark = SRGBA<uint8_t> { 255, 255, 255, 200 };
 static constexpr auto spinButtonBorderColorDark = SRGBA<uint8_t> { 255, 255, 255, 25 };
 static constexpr auto spinButtonBackgroundColorDark = SRGBA<uint8_t> { 45, 45, 45 };
 static constexpr auto spinButtonBackgroundHoveredColorDark = SRGBA<uint8_t> { 255, 255, 255, 50 };
@@ -201,14 +201,14 @@
     return Theme::controlBorder(part, font, zoomedBox, zoomFactor);
 }
 
-void ThemeAdwaita::paint(ControlPart part, ControlStates& states, GraphicsContext& context, const FloatRect& zoomedRect, float, ScrollView*, float, float, bool, bool useDarkAppearance, const Color&)
+void ThemeAdwaita::paint(ControlPart part, ControlStates& states, GraphicsContext& context, const FloatRect& zoomedRect, float, ScrollView*, float, float, bool, bool useDarkAppearance, const Color& effectiveAccentColor)
 {
     switch (part) {
     case CheckboxPart:
-        paintCheckbox(states, context, zoomedRect, useDarkAppearance);
+        paintCheckbox(states, context, zoomedRect, useDarkAppearance, effectiveAccentColor);
         break;
     case RadioPart:
-        paintRadio(states, context, zoomedRect, useDarkAppearance);
+        paintRadio(states, context, zoomedRect, useDarkAppearance, effectiveAccentColor);
         break;
     case PushButtonPart:
     case DefaultButtonPart:
@@ -224,7 +224,7 @@
     }
 }
 
-void ThemeAdwaita::paintCheckbox(ControlStates& states, GraphicsContext& graphicsContext, const FloatRect& zoomedRect, bool useDarkAppearance)
+void ThemeAdwaita::paintCheckbox(ControlStates& states, GraphicsContext& graphicsContext, const FloatRect& zoomedRect, bool useDarkAppearance, const Color& effectiveAccentColor)
 {
     GraphicsContextStateSaver stateSaver(graphicsContext);
 
@@ -238,48 +238,37 @@
             fieldRect.move(0, (zoomedRect.height() - fieldRect.height()) / 2.0);
     }
 
-    SRGBA<uint8_t> buttonBorderColor;
-    SRGBA<uint8_t> toggleBackgroundColor;
-    SRGBA<uint8_t> toggleBackgroundHoveredColor;
-    SRGBA<uint8_t> toggleColor;
+    SRGBA<uint8_t> toggleBorderColor;
+    SRGBA<uint8_t> toggleBorderHoverColor;
 
     if (useDarkAppearance) {
-        buttonBorderColor = buttonBorderColorDark;
-        toggleBackgroundColor = toggleBackgroundColorDark;
-        toggleBackgroundHoveredColor = toggleBackgroundHoveredColorDark;
-        toggleColor = toggleColorDark;
+        toggleBorderColor = toggleBorderColorDark;
+        toggleBorderHoverColor = toggleBorderHoveredColorDark;
     } else {
-        buttonBorderColor = buttonBorderColorLight;
-        toggleBackgroundColor = toggleBackgroundColorLight;
-        toggleBackgroundHoveredColor = toggleBackgroundHoveredColorLight;
-        toggleColor = toggleColorLight;
+        toggleBorderColor = toggleBorderColorLight;
+        toggleBorderHoverColor = toggleBorderHoveredColorLight;
     }
 
+    Color accentColor = effectiveAccentColor.isValid() ? effectiveAccentColor : m_accentColor;
+    Color foregroundColor = accentColor.luminance() > 0.5 ? Color(SRGBA<uint8_t> { 0, 0, 0, 204 }) : Color::white;
+    Color accentHoverColor = blendSourceOver(accentColor, foregroundColor.colorWithAlphaMultipliedBy(0.1));
+
     if (!states.states().contains(ControlStates::States::Enabled))
         graphicsContext.beginTransparencyLayer(disabledOpacity);
 
     FloatSize corner(2, 2);
     Path path;
-    path.addRoundedRect(fieldRect, corner);
-    fieldRect.inflate(-buttonBorderSize);
-    corner.expand(-buttonBorderSize, -buttonBorderSize);
-    path.addRoundedRect(fieldRect, corner);
-    graphicsContext.setFillRule(WindRule::EvenOdd);
-    graphicsContext.setFillColor(buttonBorderColor);
-    graphicsContext.fillPath(path);
-    path.clear();
 
-    path.addRoundedRect(fieldRect, corner);
-    graphicsContext.setFillRule(WindRule::NonZero);
-    if (states.states().contains(ControlStates::States::Hovered)
-        && states.states().contains(ControlStates::States::Enabled))
-        graphicsContext.setFillColor(toggleBackgroundHoveredColor);
-    else
-        graphicsContext.setFillColor(toggleBackgroundColor);
-    graphicsContext.fillPath(path);
-    path.clear();
+    if (states.states().containsAny({ ControlStates::States::Checked, ControlStates::States::Indeterminate })) {
+        path.addRoundedRect(fieldRect, corner);
+        graphicsContext.setFillRule(WindRule::NonZero);
+        if (states.states().contains(ControlStates::States::Hovered) && states.states().contains(ControlStates::States::Enabled))
+            graphicsContext.setFillColor(accentHoverColor);
+        else
+            graphicsContext.setFillColor(accentColor);
+        graphicsContext.fillPath(path);
+        path.clear();
 
-    if (states.states().containsAny({ ControlStates::States::Checked, ControlStates::States::Indeterminate })) {
         GraphicsContextStateSaver checkedStateSaver(graphicsContext);
         graphicsContext.translate(fieldRect.x(), fieldRect.y());
         graphicsContext.scale(FloatSize::narrowPrecision(fieldRect.width() / toggleSize, fieldRect.height() / toggleSize));
@@ -294,10 +283,22 @@
         } else
             path.addRoundedRect(FloatRect(2, 5, 10, 4), corner);
 
-        graphicsContext.setFillColor(toggleColor);
+        graphicsContext.setFillColor(foregroundColor);
 
         graphicsContext.fillPath(path);
         path.clear();
+    } else {
+        path.addRoundedRect(fieldRect, corner);
+        fieldRect.inflate(-toggleBorderSize);
+        corner.expand(-buttonBorderSize, -buttonBorderSize);
+        path.addRoundedRect(fieldRect, corner);
+        graphicsContext.setFillRule(WindRule::EvenOdd);
+        if (states.states().contains(ControlStates::States::Hovered) && states.states().contains(ControlStates::States::Enabled))
+            graphicsContext.setFillColor(toggleBorderHoverColor);
+        else
+            graphicsContext.setFillColor(toggleBorderColor);
+        graphicsContext.fillPath(path);
+        path.clear();
     }
 
     if (states.states().contains(ControlStates::States::Focused))
@@ -307,7 +308,7 @@
         graphicsContext.endTransparencyLayer();
 }
 
-void ThemeAdwaita::paintRadio(ControlStates& states, GraphicsContext& graphicsContext, const FloatRect& zoomedRect, bool useDarkAppearance)
+void ThemeAdwaita::paintRadio(ControlStates& states, GraphicsContext& graphicsContext, const FloatRect& zoomedRect, bool useDarkAppearance, const Color& effectiveAccentColor)
 {
     GraphicsContextStateSaver stateSaver(graphicsContext);
     FloatRect fieldRect = zoomedRect;
@@ -320,50 +321,51 @@
             fieldRect.move(0, (zoomedRect.height() - fieldRect.height()) / 2.0);
     }
 
-    SRGBA<uint8_t> buttonBorderColor;
-    SRGBA<uint8_t> toggleBackgroundColor;
-    SRGBA<uint8_t> toggleBackgroundHoveredColor;
-    SRGBA<uint8_t> toggleColor;
+    SRGBA<uint8_t> toggleBorderColor;
+    SRGBA<uint8_t> toggleBorderHoverColor;
 
     if (useDarkAppearance) {
-        buttonBorderColor = buttonBorderColorDark;
-        toggleBackgroundColor = toggleBackgroundColorDark;
-        toggleBackgroundHoveredColor = toggleBackgroundHoveredColorDark;
-        toggleColor = toggleColorDark;
+        toggleBorderColor = toggleBorderColorDark;
+        toggleBorderHoverColor = toggleBorderHoveredColorDark;
     } else {
-        buttonBorderColor = buttonBorderColorLight;
-        toggleBackgroundColor = toggleBackgroundColorLight;
-        toggleBackgroundHoveredColor = toggleBackgroundHoveredColorLight;
-        toggleColor = toggleColorLight;
+        toggleBorderColor = toggleBorderColorLight;
+        toggleBorderHoverColor = toggleBorderHoveredColorLight;
     }
 
+    Color accentColor = effectiveAccentColor.isValid() ? effectiveAccentColor : m_accentColor;
+    Color foregroundColor = accentColor.luminance() > 0.5 ? Color(SRGBA<uint8_t> { 0, 0, 0, 204 }) : Color::white;
+    Color accentHoverColor = blendSourceOver(accentColor, foregroundColor.colorWithAlphaMultipliedBy(0.1));
+
     if (!states.states().contains(ControlStates::States::Enabled))
         graphicsContext.beginTransparencyLayer(disabledOpacity);
 
     Path path;
-    path.addEllipse(fieldRect);
-    fieldRect.inflate(-buttonBorderSize);
-    path.addEllipse(fieldRect);
-    graphicsContext.setFillRule(WindRule::EvenOdd);
-    graphicsContext.setFillColor(buttonBorderColor);
-    graphicsContext.fillPath(path);
-    path.clear();
 
-    path.addEllipse(fieldRect);
-    graphicsContext.setFillRule(WindRule::NonZero);
-    if (states.states().contains(ControlStates::States::Hovered)
-        && states.states().contains(ControlStates::States::Enabled))
-        graphicsContext.setFillColor(toggleBackgroundHoveredColor);
-    else
-        graphicsContext.setFillColor(toggleBackgroundColor);
-    graphicsContext.fillPath(path);
-    path.clear();
+    if (states.states().containsAny({ ControlStates::States::Checked, ControlStates::States::Indeterminate })) {
+        path.addEllipse(fieldRect);
+        graphicsContext.setFillRule(WindRule::NonZero);
+        if (states.states().contains(ControlStates::States::Hovered) && states.states().contains(ControlStates::States::Enabled))
+            graphicsContext.setFillColor(accentHoverColor);
+        else
+            graphicsContext.setFillColor(accentColor);
+        graphicsContext.fillPath(path);
+        path.clear();
 
-    if (states.states().contains(ControlStates::States::Checked)) {
         fieldRect.inflate(-(fieldRect.width() - fieldRect.width() * 0.70));
         path.addEllipse(fieldRect);
-        graphicsContext.setFillColor(toggleColor);
+        graphicsContext.setFillColor(foregroundColor);
         graphicsContext.fillPath(path);
+    } else {
+        path.addEllipse(fieldRect);
+        fieldRect.inflate(-toggleBorderSize);
+        path.addEllipse(fieldRect);
+        graphicsContext.setFillRule(WindRule::EvenOdd);
+        if (states.states().contains(ControlStates::States::Hovered) && states.states().contains(ControlStates::States::Enabled))
+            graphicsContext.setFillColor(toggleBorderHoverColor);
+        else
+            graphicsContext.setFillColor(toggleBorderColor);
+        graphicsContext.fillPath(path);
+        path.clear();
     }
 
     if (states.states().contains(ControlStates::States::Focused))

Modified: trunk/Source/WebCore/platform/adwaita/ThemeAdwaita.h (291949 => 291950)


--- trunk/Source/WebCore/platform/adwaita/ThemeAdwaita.h	2022-03-27 06:33:17 UTC (rev 291949)
+++ trunk/Source/WebCore/platform/adwaita/ThemeAdwaita.h	2022-03-27 11:53:41 UTC (rev 291950)
@@ -52,8 +52,8 @@
     LengthBox controlBorder(ControlPart, const FontCascade&, const LengthBox&, float) const final;
     void paint(ControlPart, ControlStates&, GraphicsContext&, const FloatRect&, float, ScrollView*, float, float, bool, bool, const Color&) final;
 
-    void paintCheckbox(ControlStates&, GraphicsContext&, const FloatRect&, bool);
-    void paintRadio(ControlStates&, GraphicsContext&, const FloatRect&, bool);
+    void paintCheckbox(ControlStates&, GraphicsContext&, const FloatRect&, bool, const Color&);
+    void paintRadio(ControlStates&, GraphicsContext&, const FloatRect&, bool, const Color&);
     void paintButton(ControlStates&, GraphicsContext&, const FloatRect&, bool);
     void paintSpinButton(ControlStates&, GraphicsContext&, const FloatRect&, bool);
 

Modified: trunk/Source/WebCore/rendering/RenderThemeAdwaita.cpp (291949 => 291950)


--- trunk/Source/WebCore/rendering/RenderThemeAdwaita.cpp	2022-03-27 06:33:17 UTC (rev 291949)
+++ trunk/Source/WebCore/rendering/RenderThemeAdwaita.cpp	2022-03-27 11:53:41 UTC (rev 291950)
@@ -93,11 +93,20 @@
 static constexpr auto buttonTextColorDark = SRGBA<uint8_t> { 255, 255, 255 };
 static constexpr auto buttonTextDisabledColorDark = SRGBA<uint8_t> { 255, 255, 255, 127 };
 
-static inline Color getAccentColor()
+static inline Color getSystemAccentColor()
 {
     return static_cast<ThemeAdwaita&>(Theme::singleton()).accentColor();
 }
 
+static inline Color getAccentColor(const RenderObject& renderObject)
+{
+    auto accentColor = renderObject.style().effectiveAccentColor();
+    if (accentColor.isValid())
+        return accentColor;
+
+    return getSystemAccentColor();
+}
+
 #if !PLATFORM(GTK)
 RenderTheme& RenderTheme::singleton()
 {
@@ -134,7 +143,7 @@
 
 Color RenderThemeAdwaita::platformActiveSelectionBackgroundColor(OptionSet<StyleColorOptions>) const
 {
-    return getAccentColor().colorWithAlphaMultipliedBy(0.3);
+    return getSystemAccentColor().colorWithAlphaMultipliedBy(0.3);
 }
 
 Color RenderThemeAdwaita::platformInactiveSelectionBackgroundColor(OptionSet<StyleColorOptions> options) const
@@ -284,7 +293,7 @@
     path.addRoundedRect(fieldRect, corner);
     graphicsContext.setFillRule(WindRule::EvenOdd);
     if (enabled && isFocused(renderObject))
-        graphicsContext.setFillColor(getAccentColor());
+        graphicsContext.setFillColor(getAccentColor(renderObject));
     else
         graphicsContext.setFillColor(textFieldBorderColor);
     graphicsContext.fillPath(path);
@@ -471,7 +480,8 @@
 
     path.addRoundedRect(fieldRect, corner);
     graphicsContext.setFillRule(WindRule::NonZero);
-    graphicsContext.setFillColor(getAccentColor());
+
+    graphicsContext.setFillColor(getAccentColor(renderObject));
     graphicsContext.fillPath(path);
 
     return false;
@@ -540,7 +550,7 @@
 
     path.addRoundedRect(FloatRoundedRect(rangeRect, corners));
     graphicsContext.setFillRule(WindRule::NonZero);
-    graphicsContext.setFillColor(getAccentColor());
+    graphicsContext.setFillColor(getAccentColor(renderObject));
     graphicsContext.fillPath(path);
 
 #if ENABLE(DATALIST_ELEMENT)
@@ -597,7 +607,7 @@
     path.addEllipse(fieldRect);
     graphicsContext.setFillRule(WindRule::EvenOdd);
     if (isEnabled(renderObject) && isPressed(renderObject))
-        graphicsContext.setFillColor(getAccentColor());
+        graphicsContext.setFillColor(getAccentColor(renderObject));
     else
         graphicsContext.setFillColor(sliderThumbBorderColor);
     graphicsContext.fillPath(path);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to