Commit 6dbef6ba authored by Jonathan Kew's avatar Jonathan Kew
Browse files

Bug 1729147d - Fix the serialization order for the text-decoration shorthand to...

Bug 1729147d - Fix the serialization order for the text-decoration shorthand to match the canonical order in the spec. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D124536
parent 9309bf97
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -1865,6 +1865,11 @@ already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetTextDecoration() {
        getPropertyValue(eCSSProperty_text_decoration_line));
  }

  if (!textReset->mTextDecorationThickness.IsAuto()) {
    valueList->AppendCSSValue(
        getPropertyValue(eCSSProperty_text_decoration_thickness));
  }

  if (textReset->mTextDecorationStyle != NS_STYLE_TEXT_DECORATION_STYLE_SOLID) {
    valueList->AppendCSSValue(
        getPropertyValue(eCSSProperty_text_decoration_style));
@@ -1875,11 +1880,6 @@ already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetTextDecoration() {
  SetValueFromComplexColor(val, StyleTextReset()->mTextDecorationColor);
  valueList->AppendCSSValue(val.forget());

  if (!textReset->mTextDecorationThickness.IsAuto()) {
    valueList->AppendCSSValue(
        getPropertyValue(eCSSProperty_text_decoration_thickness));
  }

  return valueList.forget();
}

+7 −7
Original line number Diff line number Diff line
@@ -88,6 +88,13 @@
                has_value = true;
            }

            if !is_auto_thickness {
                if has_value {
                    dest.write_str(" ")?;
                }
                self.text_decoration_thickness.to_css(dest)?;
            }

            % if engine == "gecko":
            if !is_solid_style {
                if has_value {
@@ -104,13 +111,6 @@
                self.text_decoration_color.to_css(dest)?;
                has_value = true;
            }

            if !is_auto_thickness {
                if has_value {
                    dest.write_str(" ")?;
                }
                self.text_decoration_thickness.to_css(dest)?;
            }
            % endif

            Ok(())
+0 −10
Original line number Diff line number Diff line
[text-decoration-computed.html]
  [Property text-decoration value '10px']
    expected: FAIL

  [Property text-decoration value 'underline red from-font']
    expected: FAIL

  [Property text-decoration value 'from-font']
    expected: FAIL
+0 −4
Original line number Diff line number Diff line
[text-decoration-valid.html]
  [e.style['text-decoration'\] = "overline green from-font" should set the property value]
    expected: FAIL