Commit 8ed2832f authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

Revert "Use Canvastext for initial color instead of hardcoded values."

This reverts commit fbe0892e.

Without the ForcedColors Blink runtime feature enabled, using Canvastext
resulted in a white text on white background default rendering on
Windows when high contrast mode was enabled in the OS.

Should be re-landed when the ForcedColors feature is enabled by default.

Bug: 1067481
Change-Id: I41a18fc1e406151085930e0953046caf5f4d9b25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2139722Reviewed-by: default avatarAlison Maher <almaher@microsoft.com>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#757140}
parent ec38f36f
......@@ -645,8 +645,8 @@
inherited: true,
field_group: "inherited",
field_template: "external",
include_paths: ["third_party/blink/renderer/core/layout/layout_theme.h"],
default_value: "LayoutTheme::GetTheme().SystemColor(CSSValueID::kCanvastext, WebColorScheme::kLight)",
include_paths: ["third_party/blink/renderer/platform/graphics/color.h"],
default_value: "Color::kBlack",
type_name: "Color",
computed_style_custom_functions: ["getter", "setter"],
style_builder_custom_functions: ["initial", "inherit", "value"],
......@@ -5432,8 +5432,8 @@
inherited: true,
field_group: "inherited",
field_template: "external",
include_paths: ["third_party/blink/renderer/core/layout/layout_theme.h"],
default_value: "LayoutTheme::GetTheme().SystemColor(CSSValueID::kCanvastext, WebColorScheme::kLight)",
include_paths: ["third_party/blink/renderer/platform/graphics/color.h"],
default_value: "Color::kBlack",
type_name: "Color",
computed_style_custom_functions: ["getter", "setter"],
style_builder_custom_functions: ["initial", "inherit", "value"],
......
......@@ -1238,10 +1238,6 @@ scoped_refptr<ComputedStyle> StyleResolver::InitialStyleForElement(
: 1);
initial_style->SetEffectiveZoom(initial_style->Zoom());
initial_style->SetInternalVisitedColor(
initial_style->InitialColorForColorScheme());
initial_style->SetColor(initial_style->InitialColorForColorScheme());
FontDescription document_font_description =
initial_style->GetFontDescription();
document_font_description.SetLocale(
......@@ -2331,6 +2327,8 @@ void StyleResolver::ApplyCascadedColorValue(StyleResolverState& state) {
state.Style()->SetColor(
StyleBuilderConverter::ConvertColor(state, *color_value));
}
} else if (state.GetElement() == GetDocument().documentElement()) {
state.Style()->SetColor(state.Style()->InitialColorForColorScheme());
}
if (const CSSValue* visited_color_value =
......
......@@ -2579,8 +2579,7 @@ class ComputedStyle : public ComputedStyleBase,
// property should be canvastext, but since we do not yet ship color-scheme
// aware system colors, we use this method instead. This should be replaced
// by default_value:"canvastext" in css_properties.json5.
return LayoutTheme::GetTheme().SystemColor(
CSSValueID::kCanvastext, UsedColorSchemeForInitialColors());
return DarkColorScheme() ? Color::kWhite : Color::kBlack;
}
Color ForcedBackplateColor() const {
......
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