⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 278648 in webkit


Ignore:
Timestamp:
Jun 8, 2021, 10:07:27 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

CSSOM test for serializing counter() fails
https://bugs.webkit.org/show_bug.cgi?id=184256

Patch by Rob Buis <rbuis@igalia.com> on 2021-06-08
Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Update improved test result.

  • web-platform-tests/css/cssom/serialize-values-expected.txt:

Source/WebCore:

The last CSS component value should be omitted if it is "decimal" [1].

Behavior matches Firefox and Chrome.

[1] https://drafts.csswg.org/cssom/#serialize-a-css-component-value

  • css/CSSPrimitiveValue.cpp:

(WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const):

LayoutTests:

Adapt to serialization change.

  • fast/css/counters/counter-cssText-expected.txt:
  • fast/css/counters/counter-cssText.html:
  • fast/css/serialization-with-double-quotes-expected.txt:
  • fast/css/serialization-with-double-quotes.html:
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r278643 r278648  
     12021-06-08  Rob Buis  <rbuis@igalia.com>
     2
     3        CSSOM test for serializing counter() fails
     4        https://bugs.webkit.org/show_bug.cgi?id=184256
     5
     6        Reviewed by Sam Weinig.
     7
     8        Adapt to serialization change.
     9
     10        * fast/css/counters/counter-cssText-expected.txt:
     11        * fast/css/counters/counter-cssText.html:
     12        * fast/css/serialization-with-double-quotes-expected.txt:
     13        * fast/css/serialization-with-double-quotes.html:
     14
    1152021-06-08  Diego Pino Garcia  <dpino@igalia.com>
    216
  • trunk/LayoutTests/fast/css/counters/counter-cssText-expected.txt

    r218446 r278648  
    44
    55
    6 PASS rules[2].style.cssText is "content: counter(section, decimal);"
    7 PASS rules[3].style.cssText is "content: counters(section, \":\", decimal);"
     6PASS rules[2].style.cssText is "content: counter(section);"
     7PASS rules[3].style.cssText is "content: counters(section, \":\");"
    88PASS rules[4].style.cssText is "content: counter(section, lower-roman);"
    99PASS rules[5].style.cssText is "content: counters(section, \",\", upper-roman);"
  • trunk/LayoutTests/fast/css/counters/counter-cssText.html

    r218446 r278648  
    3030description("Test the cssText output of counter-valued CSSPrimitiveValues");
    3131var rules = document.styleSheets[0].cssRules;
    32 shouldBeEqualToString("rules[2].style.cssText", `content: counter(section, decimal);`);
    33 shouldBeEqualToString("rules[3].style.cssText", `content: counters(section, ":", decimal);`);
     32shouldBeEqualToString("rules[2].style.cssText", `content: counter(section);`);
     33shouldBeEqualToString("rules[3].style.cssText", `content: counters(section, ":");`);
    3434shouldBeEqualToString("rules[4].style.cssText", `content: counter(section, lower-roman);`);
    3535shouldBeEqualToString("rules[5].style.cssText", `content: counters(section, ",", upper-roman);`);
  • trunk/LayoutTests/fast/css/serialization-with-double-quotes-expected.txt

    r218446 r278648  
    1111PASS ruleWithAttributeSelector.selectorText is "span[class=\"foo bar\"]"
    1212PASS getComputedStyle(document.querySelector("span[class='foo bar']")).getPropertyValue("color") is "rgb(0, 128, 0)"
    13 PASS counterRule.style.content is "counters(section, \".\", decimal)"
     13PASS counterRule.style.content is "counters(section, \".\")"
    1414PASS fontFamilyRule.style.fontFamily is "\"Two Infinite Loop\", \"Cupertino CA\""
    1515PASS getComputedStyle(document.querySelector("article")).getPropertyValue("font-family") is "\"Two Infinite Loop\", \"Cupertino CA\""
  • trunk/LayoutTests/fast/css/serialization-with-double-quotes.html

    r218446 r278648  
    4040
    4141var counterRule = styleSheet.rules[4];
    42 shouldBeEqualToString('counterRule.style.content', 'counters(section, ".", decimal)');
     42shouldBeEqualToString('counterRule.style.content', 'counters(section, ".")');
    4343
    4444var fontFamilyRule = styleSheet.rules[5];
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r278620 r278648  
     12021-06-08  Rob Buis  <rbuis@igalia.com>
     2
     3        CSSOM test for serializing counter() fails
     4        https://bugs.webkit.org/show_bug.cgi?id=184256
     5
     6        Reviewed by Sam Weinig.
     7
     8        Update improved test result.
     9
     10        * web-platform-tests/css/cssom/serialize-values-expected.txt:
     11
    1122021-06-08  Truitt Savell  <tsavell@apple.com>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/serialize-values-expected.txt

    r278540 r278648  
    320320PASS content: url("http://localhost/")
    321321PASS content: url(http://localhost/)
    322 FAIL content: counter(par-num) assert_equals: content raw inline style declaration expected "counter(par-num)" but got "counter(par-num, decimal)"
    323 FAIL content: counter(par-num, decimal) assert_equals: content raw inline style declaration expected "counter(par-num)" but got "counter(par-num, decimal)"
     322PASS content: counter(par-num)
     323PASS content: counter(par-num, decimal)
    324324PASS content: counter(par-num, upper-roman)
    325325PASS content: attr(foo-bar)
  • trunk/Source/WebCore/ChangeLog

    r278647 r278648  
     12021-06-08  Rob Buis  <rbuis@igalia.com>
     2
     3        CSSOM test for serializing counter() fails
     4        https://bugs.webkit.org/show_bug.cgi?id=184256
     5
     6        Reviewed by Sam Weinig.
     7
     8        The last CSS component value should be omitted if it is "decimal" [1].
     9
     10        Behavior matches Firefox and Chrome.
     11
     12        [1] https://drafts.csswg.org/cssom/#serialize-a-css-component-value
     13
     14        * css/CSSPrimitiveValue.cpp:
     15        (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const):
     16
    1172021-06-08  Sam Weinig  <weinig@apple.com>
    218
  • trunk/Source/WebCore/css/CSSPrimitiveValue.cpp

    r278540 r278648  
    10811081        if (!separator.isEmpty())
    10821082            serializeString(separator, result);
    1083         result.append(listStyle.isEmpty() ? "" : ", ", listStyle, ')');
     1083        if (!(listStyle.isEmpty() || listStyle == "decimal"))
     1084            result.append(", ", listStyle);
     1085        result.append(')');
    10841086        return result.toString();
    10851087    }
Note: See TracChangeset for help on using the changeset viewer.