Diff
Modified: branches/safari-606.1.17-branch/Source/WebCore/ChangeLog (231591 => 231592)
--- branches/safari-606.1.17-branch/Source/WebCore/ChangeLog 2018-05-09 20:31:13 UTC (rev 231591)
+++ branches/safari-606.1.17-branch/Source/WebCore/ChangeLog 2018-05-09 20:42:11 UTC (rev 231592)
@@ -1,3 +1,116 @@
+2018-05-09 Jason Marcell <[email protected]>
+
+ Cherry-pick r231557. rdar://problem/39853798
+
+ 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):
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231557 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2018-05-09 Timothy Hatcher <[email protected]>
+
+ 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-09 Yacine Bandou <[email protected]>
[EME][GStreamer] Crash when the mediaKeys are created before loading the media in debug conf
Modified: branches/safari-606.1.17-branch/Source/WebCore/css/StyleColor.h (231591 => 231592)
--- branches/safari-606.1.17-branch/Source/WebCore/css/StyleColor.h 2018-05-09 20:31:13 UTC (rev 231591)
+++ branches/safari-606.1.17-branch/Source/WebCore/css/StyleColor.h 2018-05-09 20:42:11 UTC (rev 231592)
@@ -53,7 +53,8 @@
enum class Options : uint8_t {
ForVisitedLink = 1 << 0,
- UseSystemAppearance = 1 << 1
+ UseSystemAppearance = 1 << 1,
+ UseDefaultAppearance = 1 << 2
};
static Color colorFromKeyword(CSSValueID, OptionSet<Options>);
Modified: branches/safari-606.1.17-branch/Source/WebCore/dom/Document.cpp (231591 => 231592)
--- branches/safari-606.1.17-branch/Source/WebCore/dom/Document.cpp 2018-05-09 20:31:13 UTC (rev 231591)
+++ branches/safari-606.1.17-branch/Source/WebCore/dom/Document.cpp 2018-05-09 20:42:11 UTC (rev 231592)
@@ -7034,11 +7034,21 @@
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;
}
Modified: branches/safari-606.1.17-branch/Source/WebCore/dom/Document.h (231591 => 231592)
--- branches/safari-606.1.17-branch/Source/WebCore/dom/Document.h 2018-05-09 20:31:13 UTC (rev 231591)
+++ branches/safari-606.1.17-branch/Source/WebCore/dom/Document.h 2018-05-09 20:42:11 UTC (rev 231592)
@@ -545,6 +545,7 @@
float deviceScaleFactor() const;
bool useSystemAppearance() const;
+ bool useDefaultAppearance() const;
OptionSet<StyleColor::Options> styleColorOptions() const;
WEBCORE_EXPORT Ref<Range> createRange();
Modified: branches/safari-606.1.17-branch/Source/WebCore/platform/Theme.cpp (231591 => 231592)
--- branches/safari-606.1.17-branch/Source/WebCore/platform/Theme.cpp 2018-05-09 20:31:13 UTC (rev 231591)
+++ branches/safari-606.1.17-branch/Source/WebCore/platform/Theme.cpp 2018-05-09 20:42:11 UTC (rev 231592)
@@ -57,7 +57,7 @@
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)
{
}
Modified: branches/safari-606.1.17-branch/Source/WebCore/platform/Theme.h (231591 => 231592)
--- branches/safari-606.1.17-branch/Source/WebCore/platform/Theme.h 2018-05-09 20:31:13 UTC (rev 231591)
+++ branches/safari-606.1.17-branch/Source/WebCore/platform/Theme.h 2018-05-09 20:42:11 UTC (rev 231592)
@@ -67,7 +67,7 @@
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.
Modified: branches/safari-606.1.17-branch/Source/WebCore/platform/mac/LocalDefaultSystemAppearance.h (231591 => 231592)
--- branches/safari-606.1.17-branch/Source/WebCore/platform/mac/LocalDefaultSystemAppearance.h 2018-05-09 20:31:13 UTC (rev 231591)
+++ branches/safari-606.1.17-branch/Source/WebCore/platform/mac/LocalDefaultSystemAppearance.h 2018-05-09 20:42:11 UTC (rev 231592)
@@ -39,7 +39,7 @@
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
Modified: branches/safari-606.1.17-branch/Source/WebCore/platform/mac/LocalDefaultSystemAppearance.mm (231591 => 231592)
--- branches/safari-606.1.17-branch/Source/WebCore/platform/mac/LocalDefaultSystemAppearance.mm 2018-05-09 20:31:13 UTC (rev 231591)
+++ branches/safari-606.1.17-branch/Source/WebCore/platform/mac/LocalDefaultSystemAppearance.mm 2018-05-09 20:42:11 UTC (rev 231592)
@@ -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 @@
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)
Modified: branches/safari-606.1.17-branch/Source/WebCore/platform/mac/ThemeMac.h (231591 => 231592)
--- branches/safari-606.1.17-branch/Source/WebCore/platform/mac/ThemeMac.h 2018-05-09 20:31:13 UTC (rev 231591)
+++ branches/safari-606.1.17-branch/Source/WebCore/platform/mac/ThemeMac.h 2018-05-09 20:42:11 UTC (rev 231592)
@@ -33,9 +33,9 @@
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 @@
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;
Modified: branches/safari-606.1.17-branch/Source/WebCore/platform/mac/ThemeMac.mm (231591 => 231592)
--- branches/safari-606.1.17-branch/Source/WebCore/platform/mac/ThemeMac.mm 2018-05-09 20:31:13 UTC (rev 231591)
+++ branches/safari-606.1.17-branch/Source/WebCore/platform/mac/ThemeMac.mm 2018-05-09 20:42:11 UTC (rev 231592)
@@ -68,16 +68,6 @@
@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 @@
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 @@
}
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 @@
[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 @@
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 @@
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 @@
// 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 @@
}
// 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 @@
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 @@
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);
Modified: branches/safari-606.1.17-branch/Source/WebCore/platform/wpe/ThemeWPE.cpp (231591 => 231592)
--- branches/safari-606.1.17-branch/Source/WebCore/platform/wpe/ThemeWPE.cpp 2018-05-09 20:31:13 UTC (rev 231591)
+++ branches/safari-606.1.17-branch/Source/WebCore/platform/wpe/ThemeWPE.cpp 2018-05-09 20:42:11 UTC (rev 231592)
@@ -57,7 +57,7 @@
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:
Modified: branches/safari-606.1.17-branch/Source/WebCore/platform/wpe/ThemeWPE.h (231591 => 231592)
--- branches/safari-606.1.17-branch/Source/WebCore/platform/wpe/ThemeWPE.h 2018-05-09 20:31:13 UTC (rev 231591)
+++ branches/safari-606.1.17-branch/Source/WebCore/platform/wpe/ThemeWPE.h 2018-05-09 20:42:11 UTC (rev 231592)
@@ -33,7 +33,7 @@
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);
Modified: branches/safari-606.1.17-branch/Source/WebCore/rendering/RenderListBox.cpp (231591 => 231592)
--- branches/safari-606.1.17-branch/Source/WebCore/rendering/RenderListBox.cpp 2018-05-09 20:31:13 UTC (rev 231591)
+++ branches/safari-606.1.17-branch/Source/WebCore/rendering/RenderListBox.cpp 2018-05-09 20:42:11 UTC (rev 231592)
@@ -460,7 +460,7 @@
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);
Modified: branches/safari-606.1.17-branch/Source/WebCore/rendering/RenderTheme.cpp (231591 => 231592)
--- branches/safari-606.1.17-branch/Source/WebCore/rendering/RenderTheme.cpp 2018-05-09 20:31:13 UTC (rev 231591)
+++ branches/safari-606.1.17-branch/Source/WebCore/rendering/RenderTheme.cpp 2018-05-09 20:42:11 UTC (rev 231592)
@@ -303,7 +303,7 @@
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 @@
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 @@
return platformActiveSelectionForegroundColor();
}
-Color RenderTheme::platformInactiveListBoxSelectionBackgroundColor(bool) const
+Color RenderTheme::platformInactiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options>) const
{
return platformInactiveSelectionBackgroundColor();
}
Modified: branches/safari-606.1.17-branch/Source/WebCore/rendering/RenderTheme.h (231591 => 231592)
--- branches/safari-606.1.17-branch/Source/WebCore/rendering/RenderTheme.h 2018-05-09 20:31:13 UTC (rev 231591)
+++ branches/safari-606.1.17-branch/Source/WebCore/rendering/RenderTheme.h 2018-05-09 20:42:11 UTC (rev 231592)
@@ -141,7 +141,7 @@
// 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 @@
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;
Modified: branches/safari-606.1.17-branch/Source/WebCore/rendering/RenderThemeGtk.cpp (231591 => 231592)
--- branches/safari-606.1.17-branch/Source/WebCore/rendering/RenderThemeGtk.cpp 2018-05-09 20:31:13 UTC (rev 231591)
+++ branches/safari-606.1.17-branch/Source/WebCore/rendering/RenderThemeGtk.cpp 2018-05-09 20:42:11 UTC (rev 231592)
@@ -1741,7 +1741,7 @@
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);
}
Modified: branches/safari-606.1.17-branch/Source/WebCore/rendering/RenderThemeGtk.h (231591 => 231592)
--- branches/safari-606.1.17-branch/Source/WebCore/rendering/RenderThemeGtk.h 2018-05-09 20:31:13 UTC (rev 231591)
+++ branches/safari-606.1.17-branch/Source/WebCore/rendering/RenderThemeGtk.h 2018-05-09 20:42:11 UTC (rev 231592)
@@ -78,7 +78,7 @@
// 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;
Modified: branches/safari-606.1.17-branch/Source/WebCore/rendering/RenderThemeMac.h (231591 => 231592)
--- branches/safari-606.1.17-branch/Source/WebCore/rendering/RenderThemeMac.h 2018-05-09 20:31:13 UTC (rev 231591)
+++ branches/safari-606.1.17-branch/Source/WebCore/rendering/RenderThemeMac.h 2018-05-09 20:42:11 UTC (rev 231592)
@@ -57,7 +57,7 @@
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;
Modified: branches/safari-606.1.17-branch/Source/WebCore/rendering/RenderThemeMac.mm (231591 => 231592)
--- branches/safari-606.1.17-branch/Source/WebCore/rendering/RenderThemeMac.mm 2018-05-09 20:31:13 UTC (rev 231591)
+++ branches/safari-606.1.17-branch/Source/WebCore/rendering/RenderThemeMac.mm 2018-05-09 20:42:11 UTC (rev 231592)
@@ -201,8 +201,9 @@
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 @@
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 @@
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::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 @@
? 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 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;