diff --git a/components/style/matching.rs b/components/style/matching.rs index 583e41ad82e..52d12037707 100644 --- a/components/style/matching.rs +++ b/components/style/matching.rs @@ -718,7 +718,7 @@ pub trait MatchMethods: TElement { let device = context.shared.stylist.device(); // Needed for the "inherit from body" quirk. - let text_color = new_primary_style.get_color().clone_color(); + let text_color = new_primary_style.get_inherited_text().clone_color(); device.set_body_text_color(text_color); } } diff --git a/components/style/properties/build.py b/components/style/properties/build.py index 3cc2a60134e..1967ed3238a 100644 --- a/components/style/properties/build.py +++ b/components/style/properties/build.py @@ -25,7 +25,6 @@ STYLE_STRUCT_LIST = [ "background", "border", "box", - "color", "column", "counters", "effects", diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index e5595673cb7..9f56c42cc2b 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -3355,9 +3355,6 @@ clip-path } -<%self:impl_trait style_struct_name="Color"> - - <%self:impl_trait style_struct_name="InheritedUI" skip_longhands="cursor"> pub fn set_cursor(&mut self, v: longhands::cursor::computed_value::T) { self.gecko.mCursor = v.keyword; diff --git a/components/style/properties/longhands/color.mako.rs b/components/style/properties/longhands/color.mako.rs deleted file mode 100644 index e2d4003a2f2..00000000000 --- a/components/style/properties/longhands/color.mako.rs +++ /dev/null @@ -1,19 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ - -<%namespace name="helpers" file="/helpers.mako.rs" /> - -<% data.new_style_struct("Color", inherited=True) %> - -<% from data import to_rust_ident %> - -${helpers.predefined_type( - "color", - "ColorPropertyValue", - "::cssparser::RGBA::new(0, 0, 0, 255)", - animation_value_type="AnimatedRGBA", - flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", - ignored_when_colors_disabled="True", - spec="https://drafts.csswg.org/css-color/#color", -)} diff --git a/components/style/properties/longhands/inherited_text.mako.rs b/components/style/properties/longhands/inherited_text.mako.rs index e8f56cf2cde..58331efa6bd 100644 --- a/components/style/properties/longhands/inherited_text.mako.rs +++ b/components/style/properties/longhands/inherited_text.mako.rs @@ -6,6 +6,16 @@ <% from data import Keyword %> <% data.new_style_struct("InheritedText", inherited=True, gecko_name="Text") %> +${helpers.predefined_type( + "color", + "ColorPropertyValue", + "::cssparser::RGBA::new(0, 0, 0, 255)", + animation_value_type="AnimatedRGBA", + flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", + ignored_when_colors_disabled="True", + spec="https://drafts.csswg.org/css-color/#color", +)} + ${helpers.predefined_type( "line-height", "LineHeight", diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index 520b4a32b51..c2b390c89d9 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -2832,7 +2832,7 @@ impl ComputedValues { /// style.resolve_color(style.get_border().clone_border_top_color()); #[inline] pub fn resolve_color(&self, color: computed::Color) -> RGBA { - color.to_rgba(self.get_color().clone_color()) + color.to_rgba(self.get_inherited_text().clone_color()) } } diff --git a/components/style/values/specified/color.rs b/components/style/values/specified/color.rs index 5405fc6602f..48918d5bb22 100644 --- a/components/style/values/specified/color.rs +++ b/components/style/values/specified/color.rs @@ -645,7 +645,7 @@ impl ToComputedValue for ColorPropertyValue { fn to_computed_value(&self, context: &Context) -> RGBA { self.0 .to_computed_value(context) - .to_rgba(context.builder.get_parent_color().clone_color()) + .to_rgba(context.builder.get_parent_inherited_text().clone_color()) } #[inline]