diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 967ffa21972..5d3ebaae4e8 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -2204,7 +2204,7 @@ fn static_assert() { <%self:impl_trait style_struct_name="InheritedText" skip_longhands="text-align text-emphasis-style text-shadow line-height letter-spacing word-spacing - -webkit-text-stroke-width text-emphasis-position"> + -webkit-text-stroke-width text-emphasis-position -moz-tab-size"> <% text_align_keyword = Keyword("text-align", "start end left right center justify -moz-center -moz-left " + "-moz-right match-parent") %> @@ -2373,6 +2373,22 @@ fn static_assert() { <%call expr="impl_app_units('_webkit_text_stroke_width', 'mWebkitTextStrokeWidth', need_clone=False)"> + #[allow(non_snake_case)] + pub fn set__moz_tab_size(&mut self, v: longhands::_moz_tab_size::computed_value::T) { + use values::Either; + + match v { + Either::Second(number) => { + self.gecko.mTabSize.set_value(CoordDataValue::Factor(number)); + } + Either::First(au) => { + self.gecko.mTabSize.set(au); + } + } + } + + <%call expr="impl_coord_copy('_moz_tab_size', 'mTabSize')"> + <%self:impl_trait style_struct_name="Text" diff --git a/components/style/properties/longhand/border.mako.rs b/components/style/properties/longhand/border.mako.rs index 624e8ac7926..8a85377febb 100644 --- a/components/style/properties/longhand/border.mako.rs +++ b/components/style/properties/longhand/border.mako.rs @@ -257,10 +257,10 @@ ${helpers.single_keyword("-moz-float-edge", "content-box margin-box", } } - pub fn parse(_context: &ParserContext, input: &mut Parser) -> Result { + pub fn parse(context: &ParserContext, input: &mut Parser) -> Result { let mut values = vec![]; for _ in 0..4 { - let value = input.try(|input| LengthOrNumber::parse_non_negative(input)); + let value = input.try(|input| LengthOrNumber::parse_non_negative(context, input)); match value { Ok(val) => values.push(val), Err(_) => break, diff --git a/components/style/properties/longhand/inherited_text.mako.rs b/components/style/properties/longhand/inherited_text.mako.rs index 0a4d7a90632..dc3e32f99b3 100644 --- a/components/style/properties/longhand/inherited_text.mako.rs +++ b/components/style/properties/longhand/inherited_text.mako.rs @@ -1030,6 +1030,15 @@ ${helpers.predefined_type("text-emphasis-color", "CSSColor", boxed=True, spec="https://drafts.csswg.org/css-text-decor/#propdef-text-emphasis-color")} + +${helpers.predefined_type( + "-moz-tab-size", "LengthOrNumber", + "::values::Either::Second(8.0)", + "parse_non_negative", + products="gecko", animatable=False, + spec="https://drafts.csswg.org/css-text-3/#tab-size-property")} + + // CSS Compatibility // https://compat.spec.whatwg.org ${helpers.predefined_type( diff --git a/components/style/values/specified/length.rs b/components/style/values/specified/length.rs index 99c4a09abf1..fb4ac9c0b60 100644 --- a/components/style/values/specified/length.rs +++ b/components/style/values/specified/length.rs @@ -1215,7 +1215,7 @@ pub type LengthOrNumber = Either; impl LengthOrNumber { /// Parse a non-negative LengthOrNumber. - pub fn parse_non_negative(input: &mut Parser) -> Result { + pub fn parse_non_negative(_context: &ParserContext, input: &mut Parser) -> Result { // We try to parse as a Number first because, for cases like LengthOrNumber, // we want "0" to be parsed as a plain Number rather than a Length (0px); this // matches the behaviour of all major browsers