WebKit Bugzilla
Attachment 368445 Details for
Bug 197276
: REGRESSION(r244635): [GTK] Wrong background color used in non-dark mode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
wkgtk-bg-color.diff (text/plain), 6.03 KB, created by
Carlos Garcia Campos
on 2019-04-29 00:57:18 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Carlos Garcia Campos
Created:
2019-04-29 00:57:18 PDT
Size:
6.03 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index a7a243a9145..c9baebc7944 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2019-04-25 Carlos Garcia Campos <cgarcia@igalia.com> >+ >+ REGRESSION(r244635): [GTK] Wrong background color used in non-dark mode >+ https://bugs.webkit.org/show_bug.cgi?id=197276 >+ >+ Reviewed by Michael Catanzaro. >+ >+ Since r244635, we are now getting the frame view background color from the theme. That's correct for dark mode, >+ but in non-dark mode we still want to use white backgrounds by default. This made a lot of tests to fail. >+ >+ * css/CSSValueKeywords.in: Add -webkit-control-background when HAVE(OS_DARK_MODE_SUPPORT). >+ * css/html.css: Use -webkit-control-background instead of -apple-system-control-background. >+ * page/FrameView.cpp: >+ (WebCore::FrameView::updateBackgroundRecursively): Use CSSValueWindow instead of CSSValueWindowframe. >+ * rendering/RenderThemeGtk.cpp: >+ (WebCore::RenderThemeGtk::systemColor const): Only get the window background from the theme in dark mode. Handle >+ also CSSValueWebkitControlBackground. >+ * rendering/RenderThemeMac.mm: >+ (WebCore::RenderThemeMac::systemColor const): Handle CSSValueWebkitControlBackground when HAVE(OS_DARK_MODE_SUPPORT). >+ > 2019-04-25 Philippe Normand <pnormand@igalia.com> > > [GStreamer] gst_element_get_state: assertion 'GST_IS_ELEMENT (element)' failed in WebCore::MediaPlayerPrivateGStreamer::paused >diff --git a/Source/WebCore/css/CSSValueKeywords.in b/Source/WebCore/css/CSSValueKeywords.in >index e37931e961d..aa2d8545f6f 100644 >--- a/Source/WebCore/css/CSSValueKeywords.in >+++ b/Source/WebCore/css/CSSValueKeywords.in >@@ -268,6 +268,9 @@ windowtext > -apple-system-indigo > -apple-system-teal > #endif >+#if defined(HAVE_OS_DARK_MODE_SUPPORT) && HAVE_OS_DARK_MODE_SUPPORT >+-webkit-control-background >+#endif > -webkit-focus-ring-color > currentcolor > // >diff --git a/Source/WebCore/css/html.css b/Source/WebCore/css/html.css >index 82208060d35..09a968e4f1a 100644 >--- a/Source/WebCore/css/html.css >+++ b/Source/WebCore/css/html.css >@@ -389,7 +389,7 @@ input:matches([type="password"], [type="search"]) { > -webkit-appearance: textfield; > #if defined(HAVE_OS_DARK_MODE_SUPPORT) && HAVE_OS_DARK_MODE_SUPPORT > color: text; >- background-color: -apple-system-control-background; >+ background-color: -webkit-control-background; > #else > background-color: white; > #endif >@@ -667,7 +667,7 @@ textarea { > #if !(defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY) > #if defined(HAVE_OS_DARK_MODE_SUPPORT) && HAVE_OS_DARK_MODE_SUPPORT > color: text; >- background-color: -apple-system-control-background; >+ background-color: -webkit-control-background; > #else > background-color: white; > #endif >@@ -954,7 +954,7 @@ select { > border: 1px solid; > #if defined(HAVE_OS_DARK_MODE_SUPPORT) && HAVE_OS_DARK_MODE_SUPPORT > color: text; >- background-color: -apple-system-control-background; >+ background-color: -webkit-control-background; > #else > color: black; > background-color: white; >diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp >index 7a7b72e8832..50813d83a39 100644 >--- a/Source/WebCore/page/FrameView.cpp >+++ b/Source/WebCore/page/FrameView.cpp >@@ -3004,7 +3004,7 @@ void FrameView::updateBackgroundRecursively(const Optional<Color>& backgroundCol > #if PLATFORM(MAC) || PLATFORM(IOS_FAMILY) > static const auto cssValueControlBackground = CSSValueAppleSystemControlBackground; > #else >- static const auto cssValueControlBackground = CSSValueWindowframe; >+ static const auto cssValueControlBackground = CSSValueWindow; > #endif > Color baseBackgroundColor = backgroundColor.valueOr(RenderTheme::singleton().systemColor(cssValueControlBackground, styleColorOptions())); > #else >diff --git a/Source/WebCore/rendering/RenderThemeGtk.cpp b/Source/WebCore/rendering/RenderThemeGtk.cpp >index a6dbb55fc4d..9286cf6b5b6 100644 >--- a/Source/WebCore/rendering/RenderThemeGtk.cpp >+++ b/Source/WebCore/rendering/RenderThemeGtk.cpp >@@ -1780,13 +1780,24 @@ Color RenderThemeGtk::systemColor(CSSValueID cssValueId, OptionSet<StyleColor::O > return styleColor(Entry, GTK_STATE_FLAG_ACTIVE, StyleColorForeground); > case CSSValueGraytext: > return styleColor(Entry, GTK_STATE_FLAG_INSENSITIVE, StyleColorForeground); >+ case CSSValueWebkitControlBackground: >+ return styleColor(Entry, GTK_STATE_FLAG_ACTIVE, StyleColorBackground); > #if GTK_CHECK_VERSION(3, 20, 0) >- case CSSValueWindowframe: >- return styleColor(Window, GTK_STATE_FLAG_ACTIVE, StyleColorBackground); >+ case CSSValueWindow: { >+ // Only get window color from the theme in dark mode. >+ gboolean preferDarkTheme = FALSE; >+ if (auto* settings = gtk_settings_get_default()) >+ g_object_get(settings, "gtk-application-prefer-dark-theme", &preferDarkTheme, nullptr); >+ if (preferDarkTheme) >+ return styleColor(Window, GTK_STATE_FLAG_ACTIVE, StyleColorBackground); >+ break; >+ } > #endif > default: >- return RenderTheme::systemColor(cssValueId, options); >+ break; > } >+ >+ return RenderTheme::systemColor(cssValueId, options); > } > > void RenderThemeGtk::platformColorsDidChange() >diff --git a/Source/WebCore/rendering/RenderThemeMac.mm b/Source/WebCore/rendering/RenderThemeMac.mm >index cc1f06f8a6e..552f0bdeeb3 100644 >--- a/Source/WebCore/rendering/RenderThemeMac.mm >+++ b/Source/WebCore/rendering/RenderThemeMac.mm >@@ -715,6 +715,9 @@ Color RenderThemeMac::systemColor(CSSValueID cssValueID, OptionSet<StyleColor::O > case CSSValueAppleSystemTextBackground: > return @selector(textBackgroundColor); > case CSSValueAppleSystemControlBackground: >+#if HAVE(OS_DARK_MODE_SUPPORT) >+ case CSSValueWebkitControlBackground: >+#endif > return @selector(controlBackgroundColor); > case CSSValueAppleSystemAlternateSelectedText: > return @selector(alternateSelectedControlTextColor);
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 197276
:
368224
|
368233
|
368310
|
368314
| 368445