Commit 86766988 authored by Sam Sebree's avatar Sam Sebree Committed by Commit Bot

[Controls Refresh] Update the default dark background color on Chromium

This CL changes the default background color for pages with the <meta name="color-scheme" content="light dark"> tag.

Bug: 1094649
Change-Id: I80afe70345a99daa4de47a54c704e46c267ebec0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2271520
Commit-Queue: Sam Sebree <sasebree@microsoft.com>
Reviewed-by: default avatarMason Freed <masonfreed@chromium.org>
Cr-Commit-Position: refs/heads/master@{#784152}
parent 2aad8ee6
...@@ -2187,7 +2187,7 @@ void StyleEngine::UpdateForcedBackgroundColor() { ...@@ -2187,7 +2187,7 @@ void StyleEngine::UpdateForcedBackgroundColor() {
Color StyleEngine::ColorAdjustBackgroundColor() const { Color StyleEngine::ColorAdjustBackgroundColor() const {
if (use_dark_background_ && forced_colors_ == ForcedColors::kNone) if (use_dark_background_ && forced_colors_ == ForcedColors::kNone)
return Color::kBlack; return Color(0x12, 0x12, 0x12);
DCHECK(forced_colors_ != ForcedColors::kNone); DCHECK(forced_colors_ != ForcedColors::kNone);
return ForcedBackgroundColor(); return ForcedBackgroundColor();
......
...@@ -2167,7 +2167,8 @@ TEST_F(StyleEngineTest, ColorSchemeBaseBackgroundChange) { ...@@ -2167,7 +2167,8 @@ TEST_F(StyleEngineTest, ColorSchemeBaseBackgroundChange) {
CSSPropertyID::kColorScheme, "dark"); CSSPropertyID::kColorScheme, "dark");
UpdateAllLifecyclePhases(); UpdateAllLifecyclePhases();
EXPECT_EQ(Color::kBlack, GetDocument().View()->BaseBackgroundColor()); EXPECT_EQ(Color(0x12, 0x12, 0x12),
GetDocument().View()->BaseBackgroundColor());
color_scheme_helper.SetForcedColors(GetDocument(), ForcedColors::kActive); color_scheme_helper.SetForcedColors(GetDocument(), ForcedColors::kActive);
UpdateAllLifecyclePhases(); UpdateAllLifecyclePhases();
......
...@@ -583,13 +583,13 @@ TEST_F(WebViewTest, SetBaseBackgroundColorWithColorScheme) { ...@@ -583,13 +583,13 @@ TEST_F(WebViewTest, SetBaseBackgroundColorWithColorScheme) {
color_scheme_helper.SetPreferredColorScheme(PreferredColorScheme::kDark); color_scheme_helper.SetPreferredColorScheme(PreferredColorScheme::kDark);
UpdateAllLifecyclePhases(); UpdateAllLifecyclePhases();
EXPECT_EQ(Color::kBlack, frame_view->BaseBackgroundColor()); EXPECT_EQ(Color(0x12, 0x12, 0x12), frame_view->BaseBackgroundColor());
// Don't let dark color-scheme override a transparent background. // Don't let dark color-scheme override a transparent background.
web_view->SetBaseBackgroundColor(SK_ColorTRANSPARENT); web_view->SetBaseBackgroundColor(SK_ColorTRANSPARENT);
EXPECT_EQ(Color::kTransparent, frame_view->BaseBackgroundColor()); EXPECT_EQ(Color::kTransparent, frame_view->BaseBackgroundColor());
web_view->SetBaseBackgroundColor(SK_ColorBLUE); web_view->SetBaseBackgroundColor(SK_ColorBLUE);
EXPECT_EQ(Color::kBlack, frame_view->BaseBackgroundColor()); EXPECT_EQ(Color(0x12, 0x12, 0x12), frame_view->BaseBackgroundColor());
color_scheme_helper.SetForcedColors(*(web_view->GetPage()), color_scheme_helper.SetForcedColors(*(web_view->GetPage()),
ForcedColors::kActive); ForcedColors::kActive);
...@@ -602,7 +602,7 @@ TEST_F(WebViewTest, SetBaseBackgroundColorWithColorScheme) { ...@@ -602,7 +602,7 @@ TEST_F(WebViewTest, SetBaseBackgroundColorWithColorScheme) {
color_scheme_helper.SetForcedColors(*(web_view->GetPage()), color_scheme_helper.SetForcedColors(*(web_view->GetPage()),
ForcedColors::kNone); ForcedColors::kNone);
UpdateAllLifecyclePhases(); UpdateAllLifecyclePhases();
EXPECT_EQ(Color::kBlack, frame_view->BaseBackgroundColor()); EXPECT_EQ(Color(0x12, 0x12, 0x12), frame_view->BaseBackgroundColor());
color_scheme_helper.SetPreferredColorScheme(PreferredColorScheme::kLight); color_scheme_helper.SetPreferredColorScheme(PreferredColorScheme::kLight);
UpdateAllLifecyclePhases(); UpdateAllLifecyclePhases();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment