WebKit Bugzilla
Attachment 339920 Details for
Bug 185458
: Use StyleColor::Options in more places
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185458-20180508193130.patch (text/plain), 31.96 KB, created by
Timothy Hatcher
on 2018-05-08 19:31:31 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Timothy Hatcher
Created:
2018-05-08 19:31:31 PDT
Size:
31.96 KB
patch
obsolete
>Subversion Revision: 231484 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 9978f968a09a6e95f12bfc811c4711f7d5951d57..d0ba83bcdae36bbae567b758daa444f109f5c766 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,57 @@ >+2018-05-08 Timothy Hatcher <timothy@apple.com> >+ >+ Use StyleColor::Options in more places. >+ >+ https://bugs.webkit.org/show_bug.cgi?id=185458 >+ rdar://problem/39853798 >+ >+ Add UseDefaultAppearance to StyleColor::Options, to avoid passing yet another >+ boolean on some of these functions. >+ >+ Reviewed by Tim Horton. >+ >+ * css/MediaQueryEvaluator.cpp: >+ * css/StyleColor.h: >+ * dom/Document.cpp: >+ (WebCore::Document::useDefaultAppearance const): >+ (WebCore::Document::styleColorOptions const): >+ * dom/Document.h: >+ * platform/Theme.cpp: >+ (WebCore::Theme::paint): >+ * platform/Theme.h: >+ * platform/mac/LocalDefaultSystemAppearance.h: >+ * platform/mac/LocalDefaultSystemAppearance.mm: >+ (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance): >+ (WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance): >+ * platform/mac/ThemeMac.h: >+ * platform/mac/ThemeMac.mm: >+ (WebCore::paintToggleButton): >+ (WebCore::paintButton): >+ (WebCore::ThemeMac::ensuredView): >+ (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext): >+ (WebCore::ThemeMac::paint): >+ (-[WebCoreThemeView initWithUseSystemAppearance:]): Deleted. >+ * platform/wpe/ThemeWPE.cpp: >+ (WebCore::ThemeWPE::paint): >+ * platform/wpe/ThemeWPE.h: >+ * rendering/RenderListBox.cpp: >+ (WebCore::RenderListBox::paintItemBackground): >+ * rendering/RenderTheme.cpp: >+ (WebCore::RenderTheme::paint): >+ (WebCore::RenderTheme::inactiveListBoxSelectionBackgroundColor const): >+ (WebCore::RenderTheme::platformInactiveListBoxSelectionBackgroundColor const): >+ * rendering/RenderTheme.h: >+ * rendering/RenderThemeGtk.cpp: >+ (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionBackgroundColor const): >+ * rendering/RenderThemeGtk.h: >+ * rendering/RenderThemeMac.h: >+ * rendering/RenderThemeMac.mm: >+ (WebCore::RenderThemeMac::documentViewFor const): >+ (WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const): >+ (WebCore::RenderThemeMac::systemColor const): >+ (WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary): >+ (WebCore::RenderThemeMac::paintSliderThumb): >+ > 2018-05-07 Zalan Bujtas <zalan@apple.com> > > [LFC] Add FormattingContext::layoutOutOfFlowDescendants implementation >diff --git a/Source/WebCore/css/StyleColor.h b/Source/WebCore/css/StyleColor.h >index decb2aa6b6365c03dbe00135249e0acd7a2a960a..a7b81d94bf4a6bc7ca65c447856b6b1839479faa 100644 >--- a/Source/WebCore/css/StyleColor.h >+++ b/Source/WebCore/css/StyleColor.h >@@ -53,7 +53,8 @@ public: > > enum class Options : uint8_t { > ForVisitedLink = 1 << 0, >- UseSystemAppearance = 1 << 1 >+ UseSystemAppearance = 1 << 1, >+ UseDefaultAppearance = 1 << 2 > }; > > static Color colorFromKeyword(CSSValueID, OptionSet<Options>); >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index d1bb4f37b595bfd055ffc0ab8970d30a25580a58..95a3033408177ab8d2f4b3bd9bd5b7cac39aa12a 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -7034,11 +7034,21 @@ bool Document::useSystemAppearance() const > return useSystemAppearance; > } > >+bool Document::useDefaultAppearance() const >+{ >+ bool useDefaultAppearance = true; >+ if (Page* documentPage = page()) >+ useDefaultAppearance = documentPage->defaultAppearance(); >+ return useDefaultAppearance; >+} >+ > OptionSet<StyleColor::Options> Document::styleColorOptions() const > { > OptionSet<StyleColor::Options> options; > if (useSystemAppearance()) > options |= StyleColor::Options::UseSystemAppearance; >+ if (useDefaultAppearance()) >+ options |= StyleColor::Options::UseDefaultAppearance; > return options; > } > >diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h >index 0066219d8b020f01883ae958aa404a996ef0200c..b9eff10963e4b428e0ed238c93c5babc541b9a58 100644 >--- a/Source/WebCore/dom/Document.h >+++ b/Source/WebCore/dom/Document.h >@@ -545,6 +545,7 @@ public: > float deviceScaleFactor() const; > > bool useSystemAppearance() const; >+ bool useDefaultAppearance() const; > OptionSet<StyleColor::Options> styleColorOptions() const; > > WEBCORE_EXPORT Ref<Range> createRange(); >diff --git a/Source/WebCore/platform/Theme.cpp b/Source/WebCore/platform/Theme.cpp >index 07426e1ea0c00e20f996962a806f4a1a25a247d8..c0af192b1d1525b05ad3af5fc809487c7b2610e2 100644 >--- a/Source/WebCore/platform/Theme.cpp >+++ b/Source/WebCore/platform/Theme.cpp >@@ -57,7 +57,7 @@ bool Theme::controlRequiresPreWhiteSpace(ControlPart) const > return false; > } > >-void Theme::paint(ControlPart, ControlStates&, GraphicsContext&, const FloatRect&, float, ScrollView*, float, float, bool) >+void Theme::paint(ControlPart, ControlStates&, GraphicsContext&, const FloatRect&, float, ScrollView*, float, float, bool, bool) > { > } > >diff --git a/Source/WebCore/platform/Theme.h b/Source/WebCore/platform/Theme.h >index 163f35b03f96cf9a53f2c764ef3fb2c641ff0f06..1513dd0f86a887ea36cd404fb81d739ed1ba20b5 100644 >--- a/Source/WebCore/platform/Theme.h >+++ b/Source/WebCore/platform/Theme.h >@@ -67,7 +67,7 @@ public: > virtual bool controlRequiresPreWhiteSpace(ControlPart) const; > > // Method for painting a control. The rect is in zoomed coordinates. >- virtual void paint(ControlPart, ControlStates&, GraphicsContext&, const FloatRect& zoomedRect, float zoomFactor, ScrollView*, float deviceScaleFactor, float pageScaleFactor, bool useSystemAppearance); >+ virtual void paint(ControlPart, ControlStates&, GraphicsContext&, const FloatRect& zoomedRect, float zoomFactor, ScrollView*, float deviceScaleFactor, float pageScaleFactor, bool useSystemAppearance, bool useDefaultAppearance); > > // Some controls may spill out of their containers (e.g., the check on an OS X checkbox). When these controls repaint, > // the theme needs to communicate this inflated rect to the engine so that it can invalidate the whole control. >diff --git a/Source/WebCore/platform/mac/LocalDefaultSystemAppearance.h b/Source/WebCore/platform/mac/LocalDefaultSystemAppearance.h >index ca9e8fb5f55cf119878f1d31c504e65700fdca16..dedd9933753a927225df04775b454f2203dda886 100644 >--- a/Source/WebCore/platform/mac/LocalDefaultSystemAppearance.h >+++ b/Source/WebCore/platform/mac/LocalDefaultSystemAppearance.h >@@ -39,7 +39,7 @@ namespace WebCore { > class LocalDefaultSystemAppearance { > WTF_MAKE_NONCOPYABLE(LocalDefaultSystemAppearance); > public: >- LocalDefaultSystemAppearance(bool useSystemAppearance); >+ LocalDefaultSystemAppearance(bool useSystemAppearance, bool useDefaultAppearance); > ~LocalDefaultSystemAppearance(); > private: > #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 >diff --git a/Source/WebCore/platform/mac/LocalDefaultSystemAppearance.mm b/Source/WebCore/platform/mac/LocalDefaultSystemAppearance.mm >index adfbf4a3ae2d42e466ff0561a9ba95f1b632dcca..55123091bce5efa194a5a860e96a803787570928 100644 >--- a/Source/WebCore/platform/mac/LocalDefaultSystemAppearance.mm >+++ b/Source/WebCore/platform/mac/LocalDefaultSystemAppearance.mm >@@ -30,8 +30,11 @@ > #include <AppKit/NSAppearance.h> > > namespace WebCore { >- >-LocalDefaultSystemAppearance::LocalDefaultSystemAppearance(bool useSystemAppearance) >+ >+#if USE(APPLE_INTERNAL_SDK) >+#import <WebKitAdditions/LocalDefaultSystemAppearanceAdditions.mm> >+#else >+LocalDefaultSystemAppearance::LocalDefaultSystemAppearance(bool useSystemAppearance, bool) > { > #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 > m_savedSystemAppearance = [NSAppearance currentAppearance]; >@@ -40,15 +43,15 @@ LocalDefaultSystemAppearance::LocalDefaultSystemAppearance(bool useSystemAppeara > UNUSED_PARAM(useSystemAppearance); > #endif > } >+#endif > > LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance() > { > #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 >- if (m_savedSystemAppearance) >- [NSAppearance setCurrentAppearance:m_savedSystemAppearance.get()]; >+ [NSAppearance setCurrentAppearance:m_savedSystemAppearance.get()]; > #endif > } >- >+ > } > > #endif // USE(APPKIT) >diff --git a/Source/WebCore/platform/mac/ThemeMac.h b/Source/WebCore/platform/mac/ThemeMac.h >index cbe2cb9eb09b163851397beafba3eb17323e243d..25847e1d05a760a2f2a17a0fabb7b87725a38c9a 100644 >--- a/Source/WebCore/platform/mac/ThemeMac.h >+++ b/Source/WebCore/platform/mac/ThemeMac.h >@@ -33,9 +33,9 @@ namespace WebCore { > > class ThemeMac final : public ThemeCocoa { > public: >- static NSView *ensuredView(ScrollView*, const ControlStates&, bool useSystemAppearance, bool useUnparentedView = false); >+ static NSView *ensuredView(ScrollView*, const ControlStates&, bool useUnparentedView = false); > static void setFocusRingClipRect(const FloatRect&); >- static bool drawCellOrFocusRingWithViewIntoContext(NSCell *, GraphicsContext&, const FloatRect&, NSView *, bool drawButtonCell, bool drawFocusRing, bool useImageBuffer, float deviceScaleFactor, bool useSystemAppearance); >+ static bool drawCellOrFocusRingWithViewIntoContext(NSCell *, GraphicsContext&, const FloatRect&, NSView *, bool drawButtonCell, bool drawFocusRing, bool useImageBuffer, float deviceScaleFactor); > > private: > friend NeverDestroyed<ThemeMac>; >@@ -53,7 +53,7 @@ private: > > bool controlRequiresPreWhiteSpace(ControlPart part) const final { return part == PushButtonPart; } > >- void paint(ControlPart, ControlStates&, GraphicsContext&, const FloatRect&, float zoomFactor, ScrollView*, float deviceScaleFactor, float pageScaleFactor, bool useSystemAppearance) final; >+ void paint(ControlPart, ControlStates&, GraphicsContext&, const FloatRect&, float zoomFactor, ScrollView*, float deviceScaleFactor, float pageScaleFactor, bool useSystemAppearance, bool useDefaultAppearance) final; > void inflateControlPaintRect(ControlPart, const ControlStates&, FloatRect&, float zoomFactor) const final; > > bool userPrefersReducedMotion() const final; >diff --git a/Source/WebCore/platform/mac/ThemeMac.mm b/Source/WebCore/platform/mac/ThemeMac.mm >index 8736ef55617d7aae7a39527a91fdb066a886e816..cf7d6fb41fe6ac94003e5732c669d37733f393ed 100644 >--- a/Source/WebCore/platform/mac/ThemeMac.mm >+++ b/Source/WebCore/platform/mac/ThemeMac.mm >@@ -68,16 +68,6 @@ @end > > @implementation WebCoreThemeView > >-- (instancetype)initWithUseSystemAppearance:(BOOL)useSystemAppearance >-{ >- if (!(self = [super init])) >- return nil; >- >- WebCore::LocalDefaultSystemAppearance localAppearance(useSystemAppearance); >- [self setAppearance:[NSAppearance currentAppearance]]; >- return self; >-} >- > - (NSWindow *)window > { > // Using defer:YES prevents us from wasting any window server resources for this window, since we're not actually >@@ -394,7 +384,7 @@ static bool drawCellFocusRing(NSCell *cell, NSRect cellFrame, NSView *controlVie > return false; > } > >-static void paintToggleButton(ControlPart buttonType, ControlStates& controlStates, GraphicsContext& context, const FloatRect& zoomedRect, float zoomFactor, ScrollView* scrollView, float deviceScaleFactor, float pageScaleFactor, bool useSystemAppearance) >+static void paintToggleButton(ControlPart buttonType, ControlStates& controlStates, GraphicsContext& context, const FloatRect& zoomedRect, float zoomFactor, ScrollView* scrollView, float deviceScaleFactor, float pageScaleFactor) > { > BEGIN_BLOCK_OBJC_EXCEPTIONS > >@@ -436,7 +426,7 @@ static void paintToggleButton(ControlPart buttonType, ControlStates& controlStat > } > LocalCurrentGraphicsContext localContext(context); > >- NSView *view = ThemeMac::ensuredView(scrollView, controlStates, useSystemAppearance, true /* useUnparentedView */); >+ NSView *view = ThemeMac::ensuredView(scrollView, controlStates, true /* useUnparentedView */); > > bool needsRepaint = false; > bool useImageBuffer = pageScaleFactor != 1.0f || zoomFactor != 1.0f; >@@ -449,9 +439,9 @@ static void paintToggleButton(ControlPart buttonType, ControlStates& controlStat > > [toggleButtonCell _renderCurrentAnimationFrameInContext:context.platformContext() atLocation:NSMakePoint(0, 0)]; > if (![toggleButtonCell _stateAnimationRunning] && isCellFocused) >- needsRepaint = ThemeMac::drawCellOrFocusRingWithViewIntoContext(toggleButtonCell.get(), context, inflatedRect, view, false, true, useImageBuffer, deviceScaleFactor, useSystemAppearance); >+ needsRepaint = ThemeMac::drawCellOrFocusRingWithViewIntoContext(toggleButtonCell.get(), context, inflatedRect, view, false, true, useImageBuffer, deviceScaleFactor); > } else >- needsRepaint = ThemeMac::drawCellOrFocusRingWithViewIntoContext(toggleButtonCell.get(), context, inflatedRect, view, true, isCellFocused, useImageBuffer, deviceScaleFactor, useSystemAppearance); >+ needsRepaint = ThemeMac::drawCellOrFocusRingWithViewIntoContext(toggleButtonCell.get(), context, inflatedRect, view, true, isCellFocused, useImageBuffer, deviceScaleFactor); > > [toggleButtonCell setControlView:nil]; > >@@ -527,7 +517,7 @@ static NSButtonCell *button(ControlPart part, const ControlStates& controlStates > return cell; > } > >-static void paintButton(ControlPart part, ControlStates& controlStates, GraphicsContext& context, const FloatRect& zoomedRect, float zoomFactor, ScrollView* scrollView, float deviceScaleFactor, float pageScaleFactor, bool useSystemAppearance) >+static void paintButton(ControlPart part, ControlStates& controlStates, GraphicsContext& context, const FloatRect& zoomedRect, float zoomFactor, ScrollView* scrollView, float deviceScaleFactor, float pageScaleFactor) > { > BEGIN_BLOCK_OBJC_EXCEPTIONS > >@@ -562,14 +552,12 @@ static void paintButton(ControlPart part, ControlStates& controlStates, Graphics > > LocalCurrentGraphicsContext localContext(context); > >- NSView *view = ThemeMac::ensuredView(scrollView, controlStates, useSystemAppearance); >+ NSView *view = ThemeMac::ensuredView(scrollView, controlStates); > NSWindow *window = [view window]; >- LocalDefaultSystemAppearance localAppearance(useSystemAppearance); >- [window setAppearance:[NSAppearance currentAppearance]]; > NSButtonCell *previousDefaultButtonCell = [window defaultButtonCell]; > > bool useImageBuffer = pageScaleFactor != 1.0f || zoomFactor != 1.0f; >- bool needsRepaint = ThemeMac::drawCellOrFocusRingWithViewIntoContext(buttonCell, context, inflatedRect, view, true, states & ControlStates::FocusState, useImageBuffer, deviceScaleFactor, useSystemAppearance); >+ bool needsRepaint = ThemeMac::drawCellOrFocusRingWithViewIntoContext(buttonCell, context, inflatedRect, view, true, states & ControlStates::FocusState, useImageBuffer, deviceScaleFactor); > if (states & ControlStates::DefaultState) > [window setDefaultButtonCell:buttonCell]; > else if ([previousDefaultButtonCell isEqual:buttonCell]) >@@ -647,7 +635,7 @@ static void paintStepper(ControlStates& states, GraphicsContext& context, const > > // This will ensure that we always return a valid NSView, even if ScrollView doesn't have an associated document NSView. > // If the ScrollView doesn't have an NSView, we will return a fake NSView set up in the way AppKit expects. >-NSView *ThemeMac::ensuredView(ScrollView* scrollView, const ControlStates& controlStates, bool useSystemAppearance, bool useUnparentedView) >+NSView *ThemeMac::ensuredView(ScrollView* scrollView, const ControlStates& controlStates, bool useUnparentedView) > { > if (!useUnparentedView) { > if (NSView *documentView = scrollView->documentView()) >@@ -655,8 +643,9 @@ NSView *ThemeMac::ensuredView(ScrollView* scrollView, const ControlStates& contr > } > > // Use a fake view. >- static WebCoreThemeView *themeView = [[WebCoreThemeView alloc] initWithUseSystemAppearance:useSystemAppearance]; >+ static WebCoreThemeView *themeView = [[WebCoreThemeView alloc] init]; > [themeView setFrameSize:NSSizeFromCGSize(scrollView->totalContentsSize())]; >+ [themeView setAppearance:[NSAppearance currentAppearance]]; > > themeWindowHasKeyAppearance = !(controlStates.states() & ControlStates::WindowInactiveState); > >@@ -685,10 +674,9 @@ static inline bool drawCellOrFocusRingIntoRectWithView(NSCell *cell, NSRect rect > return false; > } > >-bool ThemeMac::drawCellOrFocusRingWithViewIntoContext(NSCell *cell, GraphicsContext& context, const FloatRect& rect, NSView *view, bool drawButtonCell, bool drawFocusRing, bool useImageBuffer, float deviceScaleFactor, bool useSystemAppearance) >+bool ThemeMac::drawCellOrFocusRingWithViewIntoContext(NSCell *cell, GraphicsContext& context, const FloatRect& rect, NSView *view, bool drawButtonCell, bool drawFocusRing, bool useImageBuffer, float deviceScaleFactor) > { > ASSERT(drawButtonCell || drawFocusRing); >- LocalDefaultSystemAppearance localAppearance(useSystemAppearance); > bool needsRepaint = false; > if (useImageBuffer) { > NSRect imageBufferDrawRect = NSRect(FloatRect(buttonFocusRectOutlineWidth, buttonFocusRectOutlineWidth, rect.width(), rect.height())); >@@ -857,20 +845,22 @@ void ThemeMac::inflateControlPaintRect(ControlPart part, const ControlStates& st > END_BLOCK_OBJC_EXCEPTIONS > } > >-void ThemeMac::paint(ControlPart part, ControlStates& states, GraphicsContext& context, const FloatRect& zoomedRect, float zoomFactor, ScrollView* scrollView, float deviceScaleFactor, float pageScaleFactor, bool useSystemAppearance) >+void ThemeMac::paint(ControlPart part, ControlStates& states, GraphicsContext& context, const FloatRect& zoomedRect, float zoomFactor, ScrollView* scrollView, float deviceScaleFactor, float pageScaleFactor, bool useSystemAppearance, bool useDefaultAppearance) > { >+ LocalDefaultSystemAppearance localAppearance(useSystemAppearance, useDefaultAppearance); >+ > switch (part) { > case CheckboxPart: >- paintToggleButton(part, states, context, zoomedRect, zoomFactor, scrollView, deviceScaleFactor, pageScaleFactor, useSystemAppearance); >+ paintToggleButton(part, states, context, zoomedRect, zoomFactor, scrollView, deviceScaleFactor, pageScaleFactor); > break; > case RadioPart: >- paintToggleButton(part, states, context, zoomedRect, zoomFactor, scrollView, deviceScaleFactor, pageScaleFactor, useSystemAppearance); >+ paintToggleButton(part, states, context, zoomedRect, zoomFactor, scrollView, deviceScaleFactor, pageScaleFactor); > break; > case PushButtonPart: > case DefaultButtonPart: > case ButtonPart: > case SquareButtonPart: >- paintButton(part, states, context, zoomedRect, zoomFactor, scrollView, deviceScaleFactor, pageScaleFactor, useSystemAppearance); >+ paintButton(part, states, context, zoomedRect, zoomFactor, scrollView, deviceScaleFactor, pageScaleFactor); > break; > case InnerSpinButtonPart: > paintStepper(states, context, zoomedRect, zoomFactor, scrollView); >diff --git a/Source/WebCore/platform/wpe/ThemeWPE.cpp b/Source/WebCore/platform/wpe/ThemeWPE.cpp >index a0b8b822401546688ae967569538ab0f2d71979a..e22a2947ee727aaf80db706ab767a7e6a1845f92 100644 >--- a/Source/WebCore/platform/wpe/ThemeWPE.cpp >+++ b/Source/WebCore/platform/wpe/ThemeWPE.cpp >@@ -57,7 +57,7 @@ LengthSize ThemeWPE::controlSize(ControlPart part, const FontCascade& fontCascad > return Theme::controlSize(part, fontCascade, zoomedSize, zoomFactor); > } > >-void ThemeWPE::paint(ControlPart part, ControlStates& states, GraphicsContext& context, const FloatRect& zoomedRect, float zoomFactor, ScrollView*, float, float, bool) >+void ThemeWPE::paint(ControlPart part, ControlStates& states, GraphicsContext& context, const FloatRect& zoomedRect, float zoomFactor, ScrollView*, float, float, bool, bool) > { > switch (part) { > case CheckboxPart: >diff --git a/Source/WebCore/platform/wpe/ThemeWPE.h b/Source/WebCore/platform/wpe/ThemeWPE.h >index f2600898acccdd13d3a1a942a4b8d0e5858b6d9c..b176a802f2a98f4fa0c01baa67f598dc08ddc723 100644 >--- a/Source/WebCore/platform/wpe/ThemeWPE.h >+++ b/Source/WebCore/platform/wpe/ThemeWPE.h >@@ -33,7 +33,7 @@ class ThemeWPE final : public Theme { > private: > LengthSize controlSize(ControlPart, const FontCascade&, const LengthSize&, float) const final; > >- void paint(ControlPart, ControlStates&, GraphicsContext&, const FloatRect&, float, ScrollView*, float, float, bool) final; >+ void paint(ControlPart, ControlStates&, GraphicsContext&, const FloatRect&, float, ScrollView*, float, float, bool, bool) final; > > void paintCheckbox(ControlStates&, GraphicsContext&, const FloatRect&, float); > void paintRadio(ControlStates&, GraphicsContext&, const FloatRect&, float); >diff --git a/Source/WebCore/rendering/RenderListBox.cpp b/Source/WebCore/rendering/RenderListBox.cpp >index fd1daf847c9613b6eeaf8e073d22e44f62252645..94f7d52f7df1663c101db1c3843264537c7e6d25 100644 >--- a/Source/WebCore/rendering/RenderListBox.cpp >+++ b/Source/WebCore/rendering/RenderListBox.cpp >@@ -460,7 +460,7 @@ void RenderListBox::paintItemBackground(PaintInfo& paintInfo, const LayoutPoint& > if (frame().selection().isFocusedAndActive() && document().focusedElement() == &selectElement()) > backColor = theme().activeListBoxSelectionBackgroundColor(); > else >- backColor = theme().inactiveListBoxSelectionBackgroundColor(document().useSystemAppearance()); >+ backColor = theme().inactiveListBoxSelectionBackgroundColor(document().styleColorOptions()); > } else > backColor = itemStyle.visitedDependentColorWithColorFilter(CSSPropertyBackgroundColor); > >diff --git a/Source/WebCore/rendering/RenderTheme.cpp b/Source/WebCore/rendering/RenderTheme.cpp >index a707f18cf134092aeeeb0fe7c18ff1cb42b0efd0..00d616539b92df606c6a1f175fa32c75a43237a1 100644 >--- a/Source/WebCore/rendering/RenderTheme.cpp >+++ b/Source/WebCore/rendering/RenderTheme.cpp >@@ -303,7 +303,7 @@ bool RenderTheme::paint(const RenderBox& box, ControlStates& controlStates, cons > case ButtonPart: > case InnerSpinButtonPart: > updateControlStatesForRenderer(box, controlStates); >- Theme::singleton().paint(part, controlStates, paintInfo.context(), devicePixelSnappedRect, box.style().effectiveZoom(), &box.view().frameView(), deviceScaleFactor, pageScaleFactor, box.page().useSystemAppearance()); >+ Theme::singleton().paint(part, controlStates, paintInfo.context(), devicePixelSnappedRect, box.style().effectiveZoom(), &box.view().frameView(), deviceScaleFactor, pageScaleFactor, box.page().useSystemAppearance(), box.page().defaultAppearance()); > return false; > default: > break; >@@ -614,10 +614,10 @@ Color RenderTheme::activeListBoxSelectionBackgroundColor() const > return m_activeListBoxSelectionBackgroundColor; > } > >-Color RenderTheme::inactiveListBoxSelectionBackgroundColor(bool useSystemAppearance) const >+Color RenderTheme::inactiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options> options) const > { > if (!m_inactiveListBoxSelectionBackgroundColor.isValid()) >- m_inactiveListBoxSelectionBackgroundColor = platformInactiveListBoxSelectionBackgroundColor(useSystemAppearance); >+ m_inactiveListBoxSelectionBackgroundColor = platformInactiveListBoxSelectionBackgroundColor(options); > return m_inactiveListBoxSelectionBackgroundColor; > } > >@@ -670,7 +670,7 @@ Color RenderTheme::platformActiveListBoxSelectionForegroundColor() const > return platformActiveSelectionForegroundColor(); > } > >-Color RenderTheme::platformInactiveListBoxSelectionBackgroundColor(bool) const >+Color RenderTheme::platformInactiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options>) const > { > return platformInactiveSelectionBackgroundColor(); > } >diff --git a/Source/WebCore/rendering/RenderTheme.h b/Source/WebCore/rendering/RenderTheme.h >index cdb349a2b5ebc662e0c939224d5a9c436738a037..7daaecc646a9ccb57bdbd065e0ec21b6853925ae 100644 >--- a/Source/WebCore/rendering/RenderTheme.h >+++ b/Source/WebCore/rendering/RenderTheme.h >@@ -141,7 +141,7 @@ public: > // List box selection colors > Color activeListBoxSelectionBackgroundColor() const; > Color activeListBoxSelectionForegroundColor() const; >- Color inactiveListBoxSelectionBackgroundColor(bool) const; >+ Color inactiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options>) const; > Color inactiveListBoxSelectionForegroundColor() const; > > // Highlighting colors for TextMatches. >@@ -261,7 +261,7 @@ protected: > virtual Color platformInactiveSelectionForegroundColor() const; > > virtual Color platformActiveListBoxSelectionBackgroundColor() const; >- virtual Color platformInactiveListBoxSelectionBackgroundColor(bool) const; >+ virtual Color platformInactiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options>) const; > virtual Color platformActiveListBoxSelectionForegroundColor() const; > virtual Color platformInactiveListBoxSelectionForegroundColor() const; > >diff --git a/Source/WebCore/rendering/RenderThemeGtk.cpp b/Source/WebCore/rendering/RenderThemeGtk.cpp >index 0785910f8bfee85bed97a99dfefdb09fb58898f8..96584aa56a8ae1f2acd4bbeefc8552ae62a9df6b 100644 >--- a/Source/WebCore/rendering/RenderThemeGtk.cpp >+++ b/Source/WebCore/rendering/RenderThemeGtk.cpp >@@ -1741,7 +1741,7 @@ Color RenderThemeGtk::platformActiveListBoxSelectionBackgroundColor() const > return styleColor(ListBox, static_cast<GtkStateFlags>(GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_FOCUSED), StyleColorBackground); > } > >-Color RenderThemeGtk::platformInactiveListBoxSelectionBackgroundColor(bool) const >+Color RenderThemeGtk::platformInactiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options>) const > { > return styleColor(ListBox, GTK_STATE_FLAG_SELECTED, StyleColorBackground); > } >diff --git a/Source/WebCore/rendering/RenderThemeGtk.h b/Source/WebCore/rendering/RenderThemeGtk.h >index 00a19e131c24ebdec7bb5a25b907bcdf62778a7e..81033e7e1c06a9412562288eea79fb3c5290003e 100644 >--- a/Source/WebCore/rendering/RenderThemeGtk.h >+++ b/Source/WebCore/rendering/RenderThemeGtk.h >@@ -78,7 +78,7 @@ public: > // List Box selection color > Color platformActiveListBoxSelectionBackgroundColor() const override; > Color platformActiveListBoxSelectionForegroundColor() const override; >- Color platformInactiveListBoxSelectionBackgroundColor(bool) const override; >+ Color platformInactiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options>) const override; > Color platformInactiveListBoxSelectionForegroundColor() const override; > > Seconds caretBlinkInterval() const override; >diff --git a/Source/WebCore/rendering/RenderThemeMac.h b/Source/WebCore/rendering/RenderThemeMac.h >index 3a8631112c7bacbc93648da8854f56e67b7c0fc8..51fcdc2fd3c07ab404c38bc1cef057e287d65127 100644 >--- a/Source/WebCore/rendering/RenderThemeMac.h >+++ b/Source/WebCore/rendering/RenderThemeMac.h >@@ -57,7 +57,7 @@ public: > Color platformInactiveSelectionBackgroundColor() const final; > Color platformActiveListBoxSelectionBackgroundColor() const final; > Color platformActiveListBoxSelectionForegroundColor() const final; >- Color platformInactiveListBoxSelectionBackgroundColor(bool) const final; >+ Color platformInactiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options>) const final; > Color platformInactiveListBoxSelectionForegroundColor() const final; > Color platformFocusRingColor(OptionSet<StyleColor::Options>) const final; > >diff --git a/Source/WebCore/rendering/RenderThemeMac.mm b/Source/WebCore/rendering/RenderThemeMac.mm >index 2fa3d46994e33c9ffa1788ab1b58b1e4d66b1c44..042e182a0da9c6e8254e4d0526be635b8d34abd8 100644 >--- a/Source/WebCore/rendering/RenderThemeMac.mm >+++ b/Source/WebCore/rendering/RenderThemeMac.mm >@@ -201,8 +201,9 @@ RenderThemeMac::RenderThemeMac() > > NSView *RenderThemeMac::documentViewFor(const RenderObject& o) const > { >+ LocalDefaultSystemAppearance localAppearance(o.page().useSystemAppearance(), o.page().defaultAppearance()); > ControlStates states(extractControlStatesForRenderer(o)); >- return ThemeMac::ensuredView(&o.view().frameView(), states, o.page().useSystemAppearance()); >+ return ThemeMac::ensuredView(&o.view().frameView(), states); > } > > #if ENABLE(VIDEO) >@@ -322,9 +323,11 @@ Color RenderThemeMac::platformFocusRingColor(OptionSet<StyleColor::Options> opti > return systemColor(CSSValueWebkitFocusRingColor, options); > } > >-Color RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor(bool useSystemAppearance) const >+Color RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options> options) const > { >- LocalDefaultSystemAppearance localAppearance(useSystemAppearance); >+ const bool useSystemAppearance = options.contains(StyleColor::Options::UseSystemAppearance); >+ const bool useDefaultAppearance = options.contains(StyleColor::Options::UseDefaultAppearance); >+ LocalDefaultSystemAppearance localAppearance(useSystemAppearance, useDefaultAppearance); > return platformInactiveSelectionBackgroundColor(); > } > >@@ -431,9 +434,10 @@ void RenderThemeMac::platformColorsDidChange() > Color RenderThemeMac::systemColor(CSSValueID cssValueID, OptionSet<StyleColor::Options> options) const > { > const bool useSystemAppearance = options.contains(StyleColor::Options::UseSystemAppearance); >+ const bool useDefaultAppearance = options.contains(StyleColor::Options::UseDefaultAppearance); > const bool forVisitedLink = options.contains(StyleColor::Options::ForVisitedLink); > >- LocalDefaultSystemAppearance localAppearance(useSystemAppearance); >+ LocalDefaultSystemAppearance localAppearance(useSystemAppearance, useDefaultAppearance); > > // The system color cache below can't handle visited links. The only color value > // that cares about visited links is CSSValueWebkitLink, so handle it here. >@@ -1412,10 +1416,11 @@ void RenderThemeMac::setPopupButtonCellState(const RenderObject& o, const IntSiz > > void RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary(NSCell* cell, const RenderObject& renderer, const PaintInfo& paintInfo, const FloatRect& rect) > { >+ LocalDefaultSystemAppearance localAppearance(renderer.page().useSystemAppearance(), renderer.page().defaultAppearance()); > bool shouldDrawFocusRing = isFocused(renderer) && renderer.style().outlineStyleIsAuto(); > bool shouldUseImageBuffer = renderer.style().effectiveZoom() != 1 || renderer.page().pageScaleFactor() != 1; > bool shouldDrawCell = true; >- if (ThemeMac::drawCellOrFocusRingWithViewIntoContext(cell, paintInfo.context(), rect, documentViewFor(renderer), shouldDrawCell, shouldDrawFocusRing, shouldUseImageBuffer, renderer.page().deviceScaleFactor(), renderer.page().useSystemAppearance())) >+ if (ThemeMac::drawCellOrFocusRingWithViewIntoContext(cell, paintInfo.context(), rect, documentViewFor(renderer), shouldDrawCell, shouldDrawFocusRing, shouldUseImageBuffer, renderer.page().deviceScaleFactor())) > renderer.page().focusController().setFocusedElementNeedsRepaint(); > } > >@@ -1493,6 +1498,8 @@ bool RenderThemeMac::paintSliderThumb(const RenderObject& o, const PaintInfo& pa > ? sliderThumbVertical() > : sliderThumbHorizontal(); > >+ LocalDefaultSystemAppearance localAppearance(o.page().useSystemAppearance(), o.page().defaultAppearance()); >+ > LocalCurrentGraphicsContext localContext(paintInfo.context()); > > // Update the various states we respond to. >@@ -1544,7 +1551,7 @@ bool RenderThemeMac::paintSliderThumb(const RenderObject& o, const PaintInfo& pa > bool shouldDrawFocusRing = false; > float deviceScaleFactor = o.page().deviceScaleFactor(); > bool shouldUseImageBuffer = deviceScaleFactor != 1 || zoomLevel != 1; >- ThemeMac::drawCellOrFocusRingWithViewIntoContext(sliderThumbCell, paintInfo.context(), unzoomedRect, view, shouldDrawCell, shouldDrawFocusRing, shouldUseImageBuffer, deviceScaleFactor, o.page().useSystemAppearance()); >+ ThemeMac::drawCellOrFocusRingWithViewIntoContext(sliderThumbCell, paintInfo.context(), unzoomedRect, view, shouldDrawCell, shouldDrawFocusRing, shouldUseImageBuffer, deviceScaleFactor); > [sliderThumbCell setControlView:nil]; > > return false;
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 185458
:
339903
|
339906
| 339920