Title: [229730] trunk/Source/WebCore
Revision
229730
Author
megan_gard...@apple.com
Date
2018-03-19 18:21:23 -0700 (Mon, 19 Mar 2018)

Log Message

Have select element respect current appearance
https://bugs.webkit.org/show_bug.cgi?id=183753

Reviewed by Tim Horton.

Not currently testable, will add tests in a later patch.

Have the menu lists/select elements follow the system colors.

* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::adjustMenuListStyle const):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (229729 => 229730)


--- trunk/Source/WebCore/ChangeLog	2018-03-20 01:08:53 UTC (rev 229729)
+++ trunk/Source/WebCore/ChangeLog	2018-03-20 01:21:23 UTC (rev 229730)
@@ -1,3 +1,17 @@
+2018-03-19  Megan Gardner  <megan_gard...@apple.com>
+
+        Have select element respect current appearance
+        https://bugs.webkit.org/show_bug.cgi?id=183753
+
+        Reviewed by Tim Horton.
+
+        Not currently testable, will add tests in a later patch.
+
+        Have the menu lists/select elements follow the system colors.
+
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::adjustMenuListStyle const):
+
 2018-03-19  Nan Wang  <n_w...@apple.com>
 
         AX: embedded attachments do not work correctly with text marker APIs on macOS

Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (229729 => 229730)


--- trunk/Source/WebCore/rendering/RenderThemeMac.mm	2018-03-20 01:08:53 UTC (rev 229729)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm	2018-03-20 01:21:23 UTC (rev 229730)
@@ -1345,8 +1345,12 @@
     style.setWhiteSpace(PRE);
 
     // Set the foreground color to black or gray when we have the aqua look.
-    // Cast to RGB32 is to work around a compiler bug.
-    style.setColor(e && !e->isDisabledFormControl() ? static_cast<RGBA32>(Color::black) : Color::darkGray);
+    Color c = Color::darkGray;
+    if (e) {
+        bool useSystemAppearance = e->document().page()->useSystemAppearance();
+        c = !e->isDisabledFormControl() ? systemColor(CSSValueButtontext, useSystemAppearance) : systemColor(CSSValueGraytext, useSystemAppearance);
+    }
+    style.setColor(c);
 
     // Set the button's vertical size.
     setSizeFromFont(style, menuListButtonSizes());
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to