WebKit Bugzilla
Attachment 341926 Details for
Bug 186288
: Selection color is dark when using Safari in dark mode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186288-20180604154637.patch (text/plain), 33.52 KB, created by
Timothy Hatcher
on 2018-06-04 15:46:37 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Timothy Hatcher
Created:
2018-06-04 15:46:37 PDT
Size:
33.52 KB
patch
obsolete
>Subversion Revision: 232389 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 71a2632f4738da0e18e4ce6739361e2a07fad37a..985e5b88c5f4a25e6f928b99063ec47ecab7ca9b 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,70 @@ >+2018-06-04 Timothy Hatcher <timothy@apple.com> >+ >+ Selection color is dark when using Safari in dark mode. >+ >+ https://bugs.webkit.org/show_bug.cgi?id=186288 >+ rdar://problem/38438625 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Pass StyleColor::Options to all of the selection color functions. >+ Removed supportsSelectionForegroundColors() from RenderThemeMac, >+ to get the default of true, since the forground colors in dark mode >+ can be different now. Use new semantic color methods on NSColor. >+ >+ * rendering/RenderElement.cpp: >+ (WebCore::RenderElement::selectionColor const): >+ (WebCore::RenderElement::selectionBackgroundColor const): >+ * rendering/RenderListBox.cpp: >+ (WebCore::RenderListBox::paintItemForeground): >+ (WebCore::RenderListBox::paintItemBackground): >+ * rendering/RenderTheme.cpp: >+ (WebCore::RenderTheme::activeSelectionBackgroundColor const): >+ (WebCore::RenderTheme::inactiveSelectionBackgroundColor const): >+ (WebCore::RenderTheme::activeSelectionForegroundColor const): >+ (WebCore::RenderTheme::inactiveSelectionForegroundColor const): >+ (WebCore::RenderTheme::activeListBoxSelectionBackgroundColor const): >+ (WebCore::RenderTheme::activeListBoxSelectionForegroundColor const): >+ (WebCore::RenderTheme::inactiveListBoxSelectionForegroundColor const): >+ (WebCore::RenderTheme::platformActiveSelectionBackgroundColor const): >+ (WebCore::RenderTheme::platformActiveSelectionForegroundColor const): >+ (WebCore::RenderTheme::platformInactiveSelectionBackgroundColor const): >+ (WebCore::RenderTheme::platformInactiveSelectionForegroundColor const): >+ (WebCore::RenderTheme::platformActiveListBoxSelectionBackgroundColor const): >+ (WebCore::RenderTheme::platformActiveListBoxSelectionForegroundColor const): >+ (WebCore::RenderTheme::platformInactiveListBoxSelectionBackgroundColor const): >+ (WebCore::RenderTheme::platformInactiveListBoxSelectionForegroundColor const): >+ * rendering/RenderTheme.h: >+ * rendering/RenderThemeGtk.cpp: >+ (WebCore::RenderThemeGtk::platformActiveSelectionBackgroundColor const): >+ (WebCore::RenderThemeGtk::platformInactiveSelectionBackgroundColor const): >+ (WebCore::RenderThemeGtk::platformActiveSelectionForegroundColor const): >+ (WebCore::RenderThemeGtk::platformInactiveSelectionForegroundColor const): >+ (WebCore::RenderThemeGtk::platformActiveListBoxSelectionBackgroundColor const): >+ (WebCore::RenderThemeGtk::platformActiveListBoxSelectionForegroundColor const): >+ (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionForegroundColor const): >+ * rendering/RenderThemeGtk.h: >+ * rendering/RenderThemeIOS.h: >+ * rendering/RenderThemeIOS.mm: >+ (WebCore::RenderThemeIOS::platformActiveSelectionBackgroundColor const): >+ (WebCore::RenderThemeIOS::platformInactiveSelectionBackgroundColor const): >+ * rendering/RenderThemeMac.h: >+ * rendering/RenderThemeMac.mm: >+ (WebCore::RenderThemeMac::platformActiveSelectionBackgroundColor const): >+ (WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const): >+ (WebCore::RenderThemeMac::platformActiveSelectionForegroundColor const): >+ (WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const): >+ (WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const): >+ (WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const): >+ (WebCore::RenderThemeMac::platformActiveListBoxSelectionForegroundColor const): >+ (WebCore::RenderThemeMac::platformInactiveListBoxSelectionForegroundColor const): >+ * rendering/RenderThemeWin.cpp: >+ (WebCore::RenderThemeWin::platformActiveSelectionBackgroundColor const): >+ (WebCore::RenderThemeWin::platformInactiveSelectionBackgroundColor const): >+ (WebCore::RenderThemeWin::platformActiveSelectionForegroundColor const): >+ (WebCore::RenderThemeWin::platformInactiveSelectionForegroundColor const): >+ * rendering/RenderThemeWin.h: >+ > 2018-05-31 Per Arne Vollan <pvollan@apple.com> > > Add OpenGL display mask to WebPage creation parameters. >diff --git a/Source/WebCore/rendering/RenderElement.cpp b/Source/WebCore/rendering/RenderElement.cpp >index 3133ca6fb025d7b862879890df7bc75244d62c50..5983b0dad93a68172c8203ef56df440a2715615a 100644 >--- a/Source/WebCore/rendering/RenderElement.cpp >+++ b/Source/WebCore/rendering/RenderElement.cpp >@@ -1372,8 +1372,8 @@ Color RenderElement::selectionColor(CSSPropertyID colorProperty) const > } > > if (frame().selection().isFocusedAndActive()) >- return theme().activeSelectionForegroundColor(); >- return theme().inactiveSelectionForegroundColor(); >+ return theme().activeSelectionForegroundColor(document().styleColorOptions()); >+ return theme().inactiveSelectionForegroundColor(document().styleColorOptions()); > } > > std::unique_ptr<RenderStyle> RenderElement::selectionPseudoStyle() const >@@ -1414,8 +1414,8 @@ Color RenderElement::selectionBackgroundColor() const > return pseudoStyle->visitedDependentColorWithColorFilter(CSSPropertyBackgroundColor).blendWithWhite(); > > if (frame().selection().isFocusedAndActive()) >- return theme().activeSelectionBackgroundColor(); >- return theme().inactiveSelectionBackgroundColor(); >+ return theme().activeSelectionBackgroundColor(document().styleColorOptions()); >+ return theme().inactiveSelectionBackgroundColor(document().styleColorOptions()); > } > > bool RenderElement::getLeadingCorner(FloatPoint& point, bool& insideFixed) const >diff --git a/Source/WebCore/rendering/RenderListBox.cpp b/Source/WebCore/rendering/RenderListBox.cpp >index bb01d6bee045434c71391601f9d6f9df8d21f586..4a312028637b7107fb4b0ba755f30cdb292bfd67 100644 >--- a/Source/WebCore/rendering/RenderListBox.cpp >+++ b/Source/WebCore/rendering/RenderListBox.cpp >@@ -425,10 +425,10 @@ void RenderListBox::paintItemForeground(PaintInfo& paintInfo, const LayoutPoint& > Color textColor = itemStyle.visitedDependentColorWithColorFilter(CSSPropertyColor); > if (isOptionElement && downcast<HTMLOptionElement>(*listItemElement).selected()) { > if (frame().selection().isFocusedAndActive() && document().focusedElement() == &selectElement()) >- textColor = theme().activeListBoxSelectionForegroundColor(); >+ textColor = theme().activeListBoxSelectionForegroundColor(document().styleColorOptions()); > // Honor the foreground color for disabled items > else if (!listItemElement->isDisabledFormControl() && !selectElement().isDisabledFormControl()) >- textColor = theme().inactiveListBoxSelectionForegroundColor(); >+ textColor = theme().inactiveListBoxSelectionForegroundColor(document().styleColorOptions()); > } > > paintInfo.context().setFillColor(textColor); >@@ -458,7 +458,7 @@ void RenderListBox::paintItemBackground(PaintInfo& paintInfo, const LayoutPoint& > Color backColor; > if (is<HTMLOptionElement>(*listItemElement) && downcast<HTMLOptionElement>(*listItemElement).selected()) { > if (frame().selection().isFocusedAndActive() && document().focusedElement() == &selectElement()) >- backColor = theme().activeListBoxSelectionBackgroundColor(); >+ backColor = theme().activeListBoxSelectionBackgroundColor(document().styleColorOptions()); > else > backColor = theme().inactiveListBoxSelectionBackgroundColor(document().styleColorOptions()); > } else >diff --git a/Source/WebCore/rendering/RenderTheme.cpp b/Source/WebCore/rendering/RenderTheme.cpp >index d67e27a34209c553e4c41f0ff10a1d3f9d0edb47..0988abbb593a30f76b124766a183d936e07582c1 100644 >--- a/Source/WebCore/rendering/RenderTheme.cpp >+++ b/Source/WebCore/rendering/RenderTheme.cpp >@@ -579,38 +579,38 @@ LayoutPoint RenderTheme::volumeSliderOffsetFromMuteButton(const RenderBox& muteB > > #endif > >-Color RenderTheme::activeSelectionBackgroundColor() const >+Color RenderTheme::activeSelectionBackgroundColor(OptionSet<StyleColor::Options> options) const > { > if (!m_activeSelectionBackgroundColor.isValid()) >- m_activeSelectionBackgroundColor = platformActiveSelectionBackgroundColor().blendWithWhite(); >+ m_activeSelectionBackgroundColor = platformActiveSelectionBackgroundColor(options).blendWithWhite(); > return m_activeSelectionBackgroundColor; > } > >-Color RenderTheme::inactiveSelectionBackgroundColor() const >+Color RenderTheme::inactiveSelectionBackgroundColor(OptionSet<StyleColor::Options> options) const > { > if (!m_inactiveSelectionBackgroundColor.isValid()) >- m_inactiveSelectionBackgroundColor = platformInactiveSelectionBackgroundColor().blendWithWhite(); >+ m_inactiveSelectionBackgroundColor = platformInactiveSelectionBackgroundColor(options).blendWithWhite(); > return m_inactiveSelectionBackgroundColor; > } > >-Color RenderTheme::activeSelectionForegroundColor() const >+Color RenderTheme::activeSelectionForegroundColor(OptionSet<StyleColor::Options> options) const > { > if (!m_activeSelectionForegroundColor.isValid() && supportsSelectionForegroundColors()) >- m_activeSelectionForegroundColor = platformActiveSelectionForegroundColor(); >+ m_activeSelectionForegroundColor = platformActiveSelectionForegroundColor(options); > return m_activeSelectionForegroundColor; > } > >-Color RenderTheme::inactiveSelectionForegroundColor() const >+Color RenderTheme::inactiveSelectionForegroundColor(OptionSet<StyleColor::Options> options) const > { > if (!m_inactiveSelectionForegroundColor.isValid() && supportsSelectionForegroundColors()) >- m_inactiveSelectionForegroundColor = platformInactiveSelectionForegroundColor(); >+ m_inactiveSelectionForegroundColor = platformInactiveSelectionForegroundColor(options); > return m_inactiveSelectionForegroundColor; > } > >-Color RenderTheme::activeListBoxSelectionBackgroundColor() const >+Color RenderTheme::activeListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options> options) const > { > if (!m_activeListBoxSelectionBackgroundColor.isValid()) >- m_activeListBoxSelectionBackgroundColor = platformActiveListBoxSelectionBackgroundColor(); >+ m_activeListBoxSelectionBackgroundColor = platformActiveListBoxSelectionBackgroundColor(options); > return m_activeListBoxSelectionBackgroundColor; > } > >@@ -621,63 +621,63 @@ Color RenderTheme::inactiveListBoxSelectionBackgroundColor(OptionSet<StyleColor: > return m_inactiveListBoxSelectionBackgroundColor; > } > >-Color RenderTheme::activeListBoxSelectionForegroundColor() const >+Color RenderTheme::activeListBoxSelectionForegroundColor(OptionSet<StyleColor::Options> options) const > { > if (!m_activeListBoxSelectionForegroundColor.isValid() && supportsListBoxSelectionForegroundColors()) >- m_activeListBoxSelectionForegroundColor = platformActiveListBoxSelectionForegroundColor(); >+ m_activeListBoxSelectionForegroundColor = platformActiveListBoxSelectionForegroundColor(options); > return m_activeListBoxSelectionForegroundColor; > } > >-Color RenderTheme::inactiveListBoxSelectionForegroundColor() const >+Color RenderTheme::inactiveListBoxSelectionForegroundColor(OptionSet<StyleColor::Options> options) const > { > if (!m_inactiveListBoxSelectionForegroundColor.isValid() && supportsListBoxSelectionForegroundColors()) >- m_inactiveListBoxSelectionForegroundColor = platformInactiveListBoxSelectionForegroundColor(); >+ m_inactiveListBoxSelectionForegroundColor = platformInactiveListBoxSelectionForegroundColor(options); > return m_inactiveListBoxSelectionForegroundColor; > } > >-Color RenderTheme::platformActiveSelectionBackgroundColor() const >+Color RenderTheme::platformActiveSelectionBackgroundColor(OptionSet<StyleColor::Options>) const > { > // Use a blue color by default if the platform theme doesn't define anything. > return Color(0, 0, 255); > } > >-Color RenderTheme::platformActiveSelectionForegroundColor() const >+Color RenderTheme::platformActiveSelectionForegroundColor(OptionSet<StyleColor::Options>) const > { > // Use a white color by default if the platform theme doesn't define anything. > return Color::white; > } > >-Color RenderTheme::platformInactiveSelectionBackgroundColor() const >+Color RenderTheme::platformInactiveSelectionBackgroundColor(OptionSet<StyleColor::Options>) const > { > // Use a grey color by default if the platform theme doesn't define anything. > // This color matches Firefox's inactive color. > return Color(176, 176, 176); > } > >-Color RenderTheme::platformInactiveSelectionForegroundColor() const >+Color RenderTheme::platformInactiveSelectionForegroundColor(OptionSet<StyleColor::Options>) const > { > // Use a black color by default. > return Color::black; > } > >-Color RenderTheme::platformActiveListBoxSelectionBackgroundColor() const >+Color RenderTheme::platformActiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options> options) const > { >- return platformActiveSelectionBackgroundColor(); >+ return platformActiveSelectionBackgroundColor(options); > } > >-Color RenderTheme::platformActiveListBoxSelectionForegroundColor() const >+Color RenderTheme::platformActiveListBoxSelectionForegroundColor(OptionSet<StyleColor::Options> options) const > { >- return platformActiveSelectionForegroundColor(); >+ return platformActiveSelectionForegroundColor(options); > } > >-Color RenderTheme::platformInactiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options>) const >+Color RenderTheme::platformInactiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options> options) const > { >- return platformInactiveSelectionBackgroundColor(); >+ return platformInactiveSelectionBackgroundColor(options); > } > >-Color RenderTheme::platformInactiveListBoxSelectionForegroundColor() const >+Color RenderTheme::platformInactiveListBoxSelectionForegroundColor(OptionSet<StyleColor::Options> options) const > { >- return platformInactiveSelectionForegroundColor(); >+ return platformInactiveSelectionForegroundColor(options); > } > > int RenderTheme::baselinePosition(const RenderBox& box) const >diff --git a/Source/WebCore/rendering/RenderTheme.h b/Source/WebCore/rendering/RenderTheme.h >index 7daaecc646a9ccb57bdbd065e0ec21b6853925ae..4ad3b599154bb559cfdaef31f3f9d14bf0f11f28 100644 >--- a/Source/WebCore/rendering/RenderTheme.h >+++ b/Source/WebCore/rendering/RenderTheme.h >@@ -133,16 +133,16 @@ public: > virtual bool supportsDataListUI(const AtomicString&) const { return false; } > > // Text selection colors. >- Color activeSelectionBackgroundColor() const; >- Color inactiveSelectionBackgroundColor() const; >- Color activeSelectionForegroundColor() const; >- Color inactiveSelectionForegroundColor() const; >+ Color activeSelectionBackgroundColor(OptionSet<StyleColor::Options>) const; >+ Color inactiveSelectionBackgroundColor(OptionSet<StyleColor::Options>) const; >+ Color activeSelectionForegroundColor(OptionSet<StyleColor::Options>) const; >+ Color inactiveSelectionForegroundColor(OptionSet<StyleColor::Options>) const; > > // List box selection colors >- Color activeListBoxSelectionBackgroundColor() const; >- Color activeListBoxSelectionForegroundColor() const; >+ Color activeListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options>) const; >+ Color activeListBoxSelectionForegroundColor(OptionSet<StyleColor::Options>) const; > Color inactiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options>) const; >- Color inactiveListBoxSelectionForegroundColor() const; >+ Color inactiveListBoxSelectionForegroundColor(OptionSet<StyleColor::Options>) const; > > // Highlighting colors for TextMatches. > virtual Color platformActiveTextSearchHighlightColor() const; >@@ -255,15 +255,15 @@ protected: > virtual void updateCachedSystemFontDescription(CSSValueID systemFontID, FontCascadeDescription&) const = 0; > > // The platform selection color. >- virtual Color platformActiveSelectionBackgroundColor() const; >- virtual Color platformInactiveSelectionBackgroundColor() const; >- virtual Color platformActiveSelectionForegroundColor() const; >- virtual Color platformInactiveSelectionForegroundColor() const; >+ virtual Color platformActiveSelectionBackgroundColor(OptionSet<StyleColor::Options>) const; >+ virtual Color platformInactiveSelectionBackgroundColor(OptionSet<StyleColor::Options>) const; >+ virtual Color platformActiveSelectionForegroundColor(OptionSet<StyleColor::Options>) const; >+ virtual Color platformInactiveSelectionForegroundColor(OptionSet<StyleColor::Options>) const; > >- virtual Color platformActiveListBoxSelectionBackgroundColor() const; >+ virtual Color platformActiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options>) const; > virtual Color platformInactiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options>) const; >- virtual Color platformActiveListBoxSelectionForegroundColor() const; >- virtual Color platformInactiveListBoxSelectionForegroundColor() const; >+ virtual Color platformActiveListBoxSelectionForegroundColor(OptionSet<StyleColor::Options>) const; >+ virtual Color platformInactiveListBoxSelectionForegroundColor(OptionSet<StyleColor::Options>) const; > > virtual bool supportsSelectionForegroundColors() const { return true; } > virtual bool supportsListBoxSelectionForegroundColors() const { return true; } >diff --git a/Source/WebCore/rendering/RenderThemeGtk.cpp b/Source/WebCore/rendering/RenderThemeGtk.cpp >index 6f3519d07d5d11588db50805275f64e2651ec81b..01ab265a037ffc13590b8fdbaae46afb226c1f4b 100644 >--- a/Source/WebCore/rendering/RenderThemeGtk.cpp >+++ b/Source/WebCore/rendering/RenderThemeGtk.cpp >@@ -1729,27 +1729,27 @@ Seconds RenderThemeGtk::caretBlinkInterval() const > return 500_us * time; > } > >-Color RenderThemeGtk::platformActiveSelectionBackgroundColor() const >+Color RenderThemeGtk::platformActiveSelectionBackgroundColor(OptionSet<StyleColor::Options>) const > { > return styleColor(EntrySelection, static_cast<GtkStateFlags>(GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_FOCUSED), StyleColorBackground); > } > >-Color RenderThemeGtk::platformInactiveSelectionBackgroundColor() const >+Color RenderThemeGtk::platformInactiveSelectionBackgroundColor(OptionSet<StyleColor::Options>) const > { > return styleColor(EntrySelection, GTK_STATE_FLAG_SELECTED, StyleColorBackground); > } > >-Color RenderThemeGtk::platformActiveSelectionForegroundColor() const >+Color RenderThemeGtk::platformActiveSelectionForegroundColor(OptionSet<StyleColor::Options>) const > { > return styleColor(EntrySelection, static_cast<GtkStateFlags>(GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_FOCUSED), StyleColorForeground); > } > >-Color RenderThemeGtk::platformInactiveSelectionForegroundColor() const >+Color RenderThemeGtk::platformInactiveSelectionForegroundColor(OptionSet<StyleColor::Options>) const > { > return styleColor(EntrySelection, GTK_STATE_FLAG_SELECTED, StyleColorForeground); > } > >-Color RenderThemeGtk::platformActiveListBoxSelectionBackgroundColor() const >+Color RenderThemeGtk::platformActiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options>) const > { > return styleColor(ListBox, static_cast<GtkStateFlags>(GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_FOCUSED), StyleColorBackground); > } >@@ -1759,12 +1759,12 @@ Color RenderThemeGtk::platformInactiveListBoxSelectionBackgroundColor(OptionSet< > return styleColor(ListBox, GTK_STATE_FLAG_SELECTED, StyleColorBackground); > } > >-Color RenderThemeGtk::platformActiveListBoxSelectionForegroundColor() const >+Color RenderThemeGtk::platformActiveListBoxSelectionForegroundColor(OptionSet<StyleColor::Options>) const > { > return styleColor(ListBox, static_cast<GtkStateFlags>(GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_FOCUSED), StyleColorForeground); > } > >-Color RenderThemeGtk::platformInactiveListBoxSelectionForegroundColor() const >+Color RenderThemeGtk::platformInactiveListBoxSelectionForegroundColor(OptionSet<StyleColor::Options>) const > { > return styleColor(ListBox, GTK_STATE_FLAG_SELECTED, StyleColorForeground); > } >diff --git a/Source/WebCore/rendering/RenderThemeGtk.h b/Source/WebCore/rendering/RenderThemeGtk.h >index aef8fed72647431761ab53a291aa03569b5d909b..3ddf0bf3dd88a3afd61e8ab7d416e3a7ac3f990b 100644 >--- a/Source/WebCore/rendering/RenderThemeGtk.h >+++ b/Source/WebCore/rendering/RenderThemeGtk.h >@@ -70,16 +70,16 @@ public: > int baselinePosition(const RenderBox&) const override; > > // The platform selection color. >- Color platformActiveSelectionBackgroundColor() const override; >- Color platformInactiveSelectionBackgroundColor() const override; >- Color platformActiveSelectionForegroundColor() const override; >- Color platformInactiveSelectionForegroundColor() const override; >+ Color platformActiveSelectionBackgroundColor(OptionSet<StyleColor::Options>) const override; >+ Color platformInactiveSelectionBackgroundColor(OptionSet<StyleColor::Options>) const override; >+ Color platformActiveSelectionForegroundColor(OptionSet<StyleColor::Options>) const override; >+ Color platformInactiveSelectionForegroundColor(OptionSet<StyleColor::Options>) const override; > > // List Box selection color >- Color platformActiveListBoxSelectionBackgroundColor() const override; >- Color platformActiveListBoxSelectionForegroundColor() const override; >+ Color platformActiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options>) const override; >+ Color platformActiveListBoxSelectionForegroundColor(OptionSet<StyleColor::Options>) const override; > Color platformInactiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options>) const override; >- Color platformInactiveListBoxSelectionForegroundColor() const override; >+ Color platformInactiveListBoxSelectionForegroundColor(OptionSet<StyleColor::Options>) const override; > > Seconds caretBlinkInterval() const override; > >diff --git a/Source/WebCore/rendering/RenderThemeIOS.h b/Source/WebCore/rendering/RenderThemeIOS.h >index 7b7ceef7448e9205bd1870a44c30fa984e41dd1e..209d281378d22c4f60dfd1ef9fd8e3b2622a09db 100644 >--- a/Source/WebCore/rendering/RenderThemeIOS.h >+++ b/Source/WebCore/rendering/RenderThemeIOS.h >@@ -109,8 +109,8 @@ protected: > void adjustSearchFieldStyle(StyleResolver&, RenderStyle&, const Element*) const override; > bool paintSearchFieldDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override; > >- Color platformActiveSelectionBackgroundColor() const override; >- Color platformInactiveSelectionBackgroundColor() const override; >+ Color platformActiveSelectionBackgroundColor(OptionSet<StyleColor::Options>) const override; >+ Color platformInactiveSelectionBackgroundColor(OptionSet<StyleColor::Options>) const override; > > #if ENABLE(TOUCH_EVENTS) > Color platformTapHighlightColor() const override { return 0x4D1A1A1A; } >diff --git a/Source/WebCore/rendering/RenderThemeIOS.mm b/Source/WebCore/rendering/RenderThemeIOS.mm >index 2efbd0c5dbe01406faae3f686cf5a921a40c8d5c..ef49daf1c958b0efd42b3ee3e5fac9c24814e80f 100644 >--- a/Source/WebCore/rendering/RenderThemeIOS.mm >+++ b/Source/WebCore/rendering/RenderThemeIOS.mm >@@ -1101,12 +1101,12 @@ bool RenderThemeIOS::paintFileUploadIconDecorations(const RenderObject&, const R > return false; > } > >-Color RenderThemeIOS::platformActiveSelectionBackgroundColor() const >+Color RenderThemeIOS::platformActiveSelectionBackgroundColor(OptionSet<StyleColor::Options>) const > { > return Color::transparent; > } > >-Color RenderThemeIOS::platformInactiveSelectionBackgroundColor() const >+Color RenderThemeIOS::platformInactiveSelectionBackgroundColor(OptionSet<StyleColor::Options>) const > { > return Color::transparent; > } >diff --git a/Source/WebCore/rendering/RenderThemeMac.h b/Source/WebCore/rendering/RenderThemeMac.h >index 51fcdc2fd3c07ab404c38bc1cef057e287d65127..05759b32b9e46f20469354a2abb12f968f2f3d2e 100644 >--- a/Source/WebCore/rendering/RenderThemeMac.h >+++ b/Source/WebCore/rendering/RenderThemeMac.h >@@ -53,12 +53,14 @@ public: > > bool isControlStyled(const RenderStyle&, const BorderData&, const FillLayer&, const Color& backgroundColor) const final; > >- Color platformActiveSelectionBackgroundColor() const final; >- Color platformInactiveSelectionBackgroundColor() const final; >- Color platformActiveListBoxSelectionBackgroundColor() const final; >- Color platformActiveListBoxSelectionForegroundColor() const final; >+ Color platformActiveSelectionBackgroundColor(OptionSet<StyleColor::Options>) const final; >+ Color platformActiveSelectionForegroundColor(OptionSet<StyleColor::Options>) const final; >+ Color platformInactiveSelectionBackgroundColor(OptionSet<StyleColor::Options>) const final; >+ Color platformInactiveSelectionForegroundColor(OptionSet<StyleColor::Options>) const final; >+ Color platformActiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options>) const final; >+ Color platformActiveListBoxSelectionForegroundColor(OptionSet<StyleColor::Options>) const final; > Color platformInactiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options>) const final; >- Color platformInactiveListBoxSelectionForegroundColor() const final; >+ Color platformInactiveListBoxSelectionForegroundColor(OptionSet<StyleColor::Options>) const final; > Color platformFocusRingColor(OptionSet<StyleColor::Options>) const final; > > ScrollbarControlSize scrollbarControlSizeForPart(ControlPart) final { return SmallScrollbar; } >@@ -114,8 +116,6 @@ private: > String imageControlsStyleSheet() const final; > #endif > >- bool supportsSelectionForegroundColors() const final { return false; } >- > bool paintTextField(const RenderObject&, const PaintInfo&, const FloatRect&) final; > void adjustTextFieldStyle(StyleResolver&, RenderStyle&, const Element*) const final; > >diff --git a/Source/WebCore/rendering/RenderThemeMac.mm b/Source/WebCore/rendering/RenderThemeMac.mm >index 7b8a79f622afd472db9eb18c2e1d6637a550b047..001f8743b70c54df840abb0dbd27e3ef87f21d70 100644 >--- a/Source/WebCore/rendering/RenderThemeMac.mm >+++ b/Source/WebCore/rendering/RenderThemeMac.mm >@@ -291,29 +291,72 @@ String RenderThemeMac::imageControlsStyleSheet() const > > #endif > >-Color RenderThemeMac::platformActiveSelectionBackgroundColor() const >+Color RenderThemeMac::platformActiveSelectionBackgroundColor(OptionSet<StyleColor::Options> options) const > { >+ LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseSystemAppearance), options.contains(StyleColor::Options::UseDefaultAppearance)); > return colorFromNSColor([NSColor selectedTextBackgroundColor]); > } > >-Color RenderThemeMac::platformInactiveSelectionBackgroundColor() const >+Color RenderThemeMac::platformInactiveSelectionBackgroundColor(OptionSet<StyleColor::Options> options) const > { >+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 >+ LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseSystemAppearance), options.contains(StyleColor::Options::UseDefaultAppearance)); >+ return colorFromNSColor([NSColor unemphasizedSelectedTextBackgroundColor]); >+#else > return colorFromNSColor([NSColor secondarySelectedControlColor]); >+#endif >+} >+ >+Color RenderThemeMac::platformActiveSelectionForegroundColor(OptionSet<StyleColor::Options> options) const >+{ >+ LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseSystemAppearance), options.contains(StyleColor::Options::UseDefaultAppearance)); >+ return colorFromNSColor([NSColor selectedTextColor]); >+} >+ >+Color RenderThemeMac::platformInactiveSelectionForegroundColor(OptionSet<StyleColor::Options> options) const >+{ >+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 >+ LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseSystemAppearance), options.contains(StyleColor::Options::UseDefaultAppearance)); >+ return colorFromNSColor([NSColor unemphasizedSelectedTextColor]); >+#else >+ return colorFromNSColor([NSColor textColor]); >+#endif > } > >-Color RenderThemeMac::platformActiveListBoxSelectionBackgroundColor() const >+Color RenderThemeMac::platformActiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options> options) const > { >+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 >+ LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseSystemAppearance), options.contains(StyleColor::Options::UseDefaultAppearance)); >+ return colorFromNSColor([NSColor selectedContentBackgroundColor]); >+#else > return colorFromNSColor([NSColor alternateSelectedControlColor]); >+#endif >+} >+ >+Color RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options> options) const >+{ >+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 >+ LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseSystemAppearance), options.contains(StyleColor::Options::UseDefaultAppearance)); >+ return colorFromNSColor([NSColor unemphasizedSelectedContentBackgroundColor]); >+#else >+ return colorFromNSColor([NSColor secondarySelectedControlColor]); >+#endif > } > >-Color RenderThemeMac::platformActiveListBoxSelectionForegroundColor() const >+Color RenderThemeMac::platformActiveListBoxSelectionForegroundColor(OptionSet<StyleColor::Options> options) const > { >- return Color::white; >+ LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseSystemAppearance), options.contains(StyleColor::Options::UseDefaultAppearance)); >+ return colorFromNSColor([NSColor alternateSelectedControlTextColor]); > } > >-Color RenderThemeMac::platformInactiveListBoxSelectionForegroundColor() const >+Color RenderThemeMac::platformInactiveListBoxSelectionForegroundColor(OptionSet<StyleColor::Options> options) const > { >- return Color::black; >+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 >+ LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseSystemAppearance), options.contains(StyleColor::Options::UseDefaultAppearance)); >+ return colorFromNSColor([NSColor unemphasizedSelectedTextColor]); >+#else >+ return colorFromNSColor([NSColor selectedControlTextColor]); >+#endif > } > > Color RenderThemeMac::platformFocusRingColor(OptionSet<StyleColor::Options> options) const >@@ -323,14 +366,6 @@ Color RenderThemeMac::platformFocusRingColor(OptionSet<StyleColor::Options> opti > return systemColor(CSSValueWebkitFocusRingColor, options); > } > >-Color RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options> options) const >-{ >- const bool useSystemAppearance = options.contains(StyleColor::Options::UseSystemAppearance); >- const bool useDefaultAppearance = options.contains(StyleColor::Options::UseDefaultAppearance); >- LocalDefaultSystemAppearance localAppearance(useSystemAppearance, useDefaultAppearance); >- return platformInactiveSelectionBackgroundColor(); >-} >- > static FontSelectionValue toFontWeight(NSInteger appKitFontWeight) > { > ASSERT(appKitFontWeight > 0 && appKitFontWeight < 15); >diff --git a/Source/WebCore/rendering/RenderThemeWin.cpp b/Source/WebCore/rendering/RenderThemeWin.cpp >index e144480c7cace70f566d7e0239fb3a89fb4dd70c..f14a38e147b8302dd0b3c1689e96a34ad1728268 100644 >--- a/Source/WebCore/rendering/RenderThemeWin.cpp >+++ b/Source/WebCore/rendering/RenderThemeWin.cpp >@@ -293,25 +293,25 @@ bool RenderThemeWin::supportsHover(const RenderStyle&) const > return haveTheme; > } > >-Color RenderThemeWin::platformActiveSelectionBackgroundColor() const >+Color RenderThemeWin::platformActiveSelectionBackgroundColor(OptionSet<StyleColor::Options>) const > { > COLORREF color = GetSysColor(COLOR_HIGHLIGHT); > return Color(GetRValue(color), GetGValue(color), GetBValue(color)); > } > >-Color RenderThemeWin::platformInactiveSelectionBackgroundColor() const >+Color RenderThemeWin::platformInactiveSelectionBackgroundColor(OptionSet<StyleColor::Options>) const > { > // This color matches Firefox. > return Color(176, 176, 176); > } > >-Color RenderThemeWin::platformActiveSelectionForegroundColor() const >+Color RenderThemeWin::platformActiveSelectionForegroundColor(OptionSet<StyleColor::Options>) const > { > COLORREF color = GetSysColor(COLOR_HIGHLIGHTTEXT); > return Color(GetRValue(color), GetGValue(color), GetBValue(color)); > } > >-Color RenderThemeWin::platformInactiveSelectionForegroundColor() const >+Color RenderThemeWin::platformInactiveSelectionForegroundColor(OptionSet<StyleColor::Options>) const > { > return platformActiveSelectionForegroundColor(); > } >diff --git a/Source/WebCore/rendering/RenderThemeWin.h b/Source/WebCore/rendering/RenderThemeWin.h >index d3f1be1f1dacba2851b888c9c1b84541c65f9ff0..fee24b6d948ba463cc4232481355fd6301c66527 100644 >--- a/Source/WebCore/rendering/RenderThemeWin.h >+++ b/Source/WebCore/rendering/RenderThemeWin.h >@@ -54,10 +54,10 @@ public: > // A method asking if the theme's controls actually care about redrawing when hovered. > bool supportsHover(const RenderStyle&) const override; > >- Color platformActiveSelectionBackgroundColor() const override; >- Color platformInactiveSelectionBackgroundColor() const override; >- Color platformActiveSelectionForegroundColor() const override; >- Color platformInactiveSelectionForegroundColor() const override; >+ Color platformActiveSelectionBackgroundColor(OptionSet<StyleColor::Options>) const override; >+ Color platformInactiveSelectionBackgroundColor(OptionSet<StyleColor::Options>) const override; >+ Color platformActiveSelectionForegroundColor(OptionSet<StyleColor::Options>) const override; >+ Color platformInactiveSelectionForegroundColor(OptionSet<StyleColor::Options>) const override; > > Color systemColor(CSSValueID, OptionSet<StyleColor::Options>) const override; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186288
:
341926
|
341931