Changeset 292759 in webkit


Ignore:
Timestamp:
Apr 11, 2022 8:43:50 PM (3 months ago)
Author:
Antti Koivisto
Message:

[CSS Container Queries] Update container shorthand order
https://bugs.webkit.org/show_bug.cgi?id=239065

Reviewed by Alan Bujtas.

LayoutTests/imported/w3c:

Update from WPT repo.

  • resources/resource-files.json:
  • web-platform-tests/css/css-contain/container-queries/at-container-parsing-expected.txt:
  • web-platform-tests/css/css-contain/container-queries/at-container-parsing.html:
  • web-platform-tests/css/css-contain/container-queries/container-computed-expected.txt:
  • web-platform-tests/css/css-contain/container-queries/container-computed.html:
  • web-platform-tests/css/css-contain/container-queries/container-name-parsing-expected.txt:
  • web-platform-tests/css/css-contain/container-queries/container-name-parsing.html:
  • web-platform-tests/css/css-contain/container-queries/container-parsing-expected.txt:
  • web-platform-tests/css/css-contain/container-queries/container-parsing.html:
  • web-platform-tests/css/css-contain/container-queries/container-selection.html:
  • web-platform-tests/css/css-contain/container-queries/container-type-parsing.html:
  • web-platform-tests/css/css-contain/container-queries/crashtests/canvas-as-container-crash.html:
  • web-platform-tests/css/css-contain/container-queries/crashtests/chrome-bug-1289718-000-crash.html:
  • web-platform-tests/css/css-contain/container-queries/crashtests/chrome-bug-1289718-001-crash.html:
  • web-platform-tests/css/css-contain/container-queries/crashtests/chrome-quotes-crash.html: Added.
  • web-platform-tests/css/css-contain/container-queries/crashtests/force-sibling-style-crash.html: Added.
  • web-platform-tests/css/css-contain/container-queries/crashtests/w3c-import.log:

Source/WebCore:

The format is now 'name / type' instead of 'type / name'.

https://drafts.csswg.org/css-contain-3/#container-shorthand

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):

  • css/StyleProperties.cpp:

(WebCore::isNoneValue):
(WebCore::isValueID):
(WebCore::StyleProperties::getPropertyValue const):

Also make "foo / none" serialize as "foo".

  • css/parser/CSSParserFastPaths.cpp:

(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):

  • css/parser/CSSPropertyParser.cpp:

(WebCore::consumeContainerName):
(WebCore::CSSPropertyParser::consumeContainerShorthand):

Location:
trunk
Files:
2 added
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r292732 r292759  
     12022-04-11  Antti Koivisto  <antti@apple.com>
     2
     3        [CSS Container Queries] Update container shorthand order
     4        https://bugs.webkit.org/show_bug.cgi?id=239065
     5
     6        Reviewed by Alan Bujtas.
     7
     8        Update from WPT repo.
     9
     10        * resources/resource-files.json:
     11        * web-platform-tests/css/css-contain/container-queries/at-container-parsing-expected.txt:
     12        * web-platform-tests/css/css-contain/container-queries/at-container-parsing.html:
     13        * web-platform-tests/css/css-contain/container-queries/container-computed-expected.txt:
     14        * web-platform-tests/css/css-contain/container-queries/container-computed.html:
     15        * web-platform-tests/css/css-contain/container-queries/container-name-parsing-expected.txt:
     16        * web-platform-tests/css/css-contain/container-queries/container-name-parsing.html:
     17        * web-platform-tests/css/css-contain/container-queries/container-parsing-expected.txt:
     18        * web-platform-tests/css/css-contain/container-queries/container-parsing.html:
     19        * web-platform-tests/css/css-contain/container-queries/container-selection.html:
     20        * web-platform-tests/css/css-contain/container-queries/container-type-parsing.html:
     21        * web-platform-tests/css/css-contain/container-queries/crashtests/canvas-as-container-crash.html:
     22        * web-platform-tests/css/css-contain/container-queries/crashtests/chrome-bug-1289718-000-crash.html:
     23        * web-platform-tests/css/css-contain/container-queries/crashtests/chrome-bug-1289718-001-crash.html:
     24        * web-platform-tests/css/css-contain/container-queries/crashtests/chrome-quotes-crash.html: Added.
     25        * web-platform-tests/css/css-contain/container-queries/crashtests/force-sibling-style-crash.html: Added.
     26        * web-platform-tests/css/css-contain/container-queries/crashtests/w3c-import.log:
     27
    1282022-04-11  Nikolaos Mouchtaris  <nmouchtaris@apple.com>
    229
  • trunk/LayoutTests/imported/w3c/resources/resource-files.json

    r292419 r292759  
    664664        "web-platform-tests/css/css-contain/container-queries/crashtests/chrome-bug-1289718-000-crash.html",
    665665        "web-platform-tests/css/css-contain/container-queries/crashtests/chrome-bug-1289718-001-crash.html",
     666        "web-platform-tests/css/css-contain/container-queries/crashtests/chrome-quotes-crash.html",
    666667        "web-platform-tests/css/css-contain/container-queries/crashtests/columns-in-table-001-crash.html",
    667668        "web-platform-tests/css/css-contain/container-queries/crashtests/container-type-change-chrome-legacy-crash.html",
     
    671672        "web-platform-tests/css/css-contain/container-queries/crashtests/flex-in-columns-003-crash.html",
    672673        "web-platform-tests/css/css-contain/container-queries/crashtests/focus-inside-content-visibility-crash.html",
     674        "web-platform-tests/css/css-contain/container-queries/crashtests/force-sibling-style-crash.html",
    673675        "web-platform-tests/css/css-contain/container-queries/crashtests/grid-in-columns-000-crash.html",
    674676        "web-platform-tests/css/css-contain/container-queries/crashtests/grid-in-columns-001-crash.html",
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-parsing-expected.txt

    r291993 r292759  
    2020PASS (not (width: 100px))
    2121PASS ((width: 100px) and (height: 100px))
    22 PASS ((width: 50px) or (height: 100px))
     22PASS (((width: 40px) or (width: 50px)) and (height: 100px))
     23PASS ((width: 100px) and ((height: 40px) or (height: 50px)))
     24PASS (((width: 40x) and (height: 50px)) or (height: 100px))
     25PASS ((width: 50px) or ((width: 40px) and (height: 50px)))
     26PASS ((width: 100px) and (not (height: 100px)))
    2327PASS (width < 100px)
     28PASS (width <= 100px)
     29PASS (width = 100px)
     30PASS (width > 100px)
     31PASS (width >= 100px)
    2432PASS (100px < width)
     33PASS (100px <= width)
     34PASS (100px = width)
     35PASS (100px > width)
     36PASS (100px >= width)
    2537PASS (100px < width < 200px)
     38PASS (100px < width <= 200px)
     39PASS (100px <= width < 200px)
     40PASS (100px > width > 200px)
     41PASS (100px > width >= 200px)
     42PASS (100px >= width > 200px)
    2643PASS foo(width)
    2744PASS size(width)
     
    3451PASS size(grid)
    3552PASS (grid)
     53PASS (width == 100px)
     54FAIL (100px == width) assert_equals: expected 2 but got 0
     55FAIL (100px = width = 200px) assert_equals: expected "" but got "true"
     56FAIL (100px < width > 200px) assert_equals: expected "" but got "true"
     57FAIL (100px <= width >= 200px) assert_equals: expected "" but got "true"
     58FAIL (100px <= width > 200px) assert_equals: expected "" but got "true"
     59FAIL (100px < width >= 200px) assert_equals: expected "" but got "true"
     60FAIL (100px : width : 200px) assert_equals: expected 2 but got 0
    3661PASS screen
    3762PASS print
     
    4368PASS not screen or (width: 100px)
    4469PASS (width: 100px), (height: 100px)
     70PASS (width: 100px) and (height: 100px)
     71PASS (width: 100px) or (height: 100px)
     72PASS not (width: 100px)
     73PASS foo (width: 100px)
    4574PASS Container selector: foo
    4675PASS Container selector:  foo
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-parsing.html

    r291993 r292759  
    55<script src="/resources/testharnessreport.js"></script>
    66<script src="support/cq-testcommon.js"></script>
    7 <div style="container:size; width:100px; height:100px">
     7<div style="container-name:name;container-type:size; width:100px; height:100px">
    88  <main id=main></main>
    99</div>
     
    2626    test(t => {
    2727      t.add_cleanup(cleanup_main);
    28       let style = set_style(`@container ${query} {}`);
     28      let style = set_style(`@container name ${query} {}`);
    2929      assert_equals(style.sheet.rules.length, 0);
    3030    }, query);
     
    3737      t.add_cleanup(cleanup_main);
    3838      let style = set_style(`
    39         @container ${query} {}
    40         @container (${query} or (not ${query})) { main { --match:true; } }
     39        @container name ${query} {}
     40        @container name (${query} or (not ${query})) { main { --match:true; } }
    4141      `);
    4242      assert_equals(style.sheet.rules.length, 2);
     
    9191  test_query_known('(not (width: 100px))');
    9292  test_query_known('((width: 100px) and (height: 100px))');
    93   test_query_known('((width: 50px) or (height: 100px))');
     93  test_query_known('(((width: 40px) or (width: 50px)) and (height: 100px))');
     94  test_query_known('((width: 100px) and ((height: 40px) or (height: 50px)))');
     95  test_query_known('(((width: 40x) and (height: 50px)) or (height: 100px))');
     96  test_query_known('((width: 50px) or ((width: 40px) and (height: 50px)))');
     97  test_query_known('((width: 100px) and (not (height: 100px)))');
    9498  test_query_known('(width < 100px)');
     99  test_query_known('(width <= 100px)');
     100  test_query_known('(width = 100px)');
     101  test_query_known('(width > 100px)');
     102  test_query_known('(width >= 100px)');
    95103  test_query_known('(100px < width)');
     104  test_query_known('(100px <= width)');
     105  test_query_known('(100px = width)');
     106  test_query_known('(100px > width)');
     107  test_query_known('(100px >= width)');
    96108  test_query_known('(100px < width < 200px)');
     109  test_query_known('(100px < width <= 200px)');
     110  test_query_known('(100px <= width < 200px)');
     111  test_query_known('(100px > width > 200px)');
     112  test_query_known('(100px > width >= 200px)');
     113  test_query_known('(100px >= width > 200px)');
    97114
    98115  test_query_unknown('foo(width)');
     
    106123  test_query_unknown('size(grid)');
    107124  test_query_unknown('(grid)');
     125  test_query_unknown('(width == 100px)');
     126  test_query_unknown('(100px == width)');
     127  test_query_unknown('(100px = width = 200px)');
     128  test_query_unknown('(100px < width > 200px)');
     129  test_query_unknown('(100px <= width >= 200px)');
     130  test_query_unknown('(100px <= width > 200px)');
     131  test_query_unknown('(100px < width >= 200px)');
     132  test_query_unknown('(100px : width : 200px)');
    108133
    109134  test_query_invalid('screen');
     
    116141  test_query_invalid('not screen or (width: 100px)');
    117142  test_query_invalid('(width: 100px), (height: 100px)');
     143  test_query_invalid('(width: 100px) and (height: 100px)');
     144  test_query_invalid('(width: 100px) or (height: 100px)');
     145  test_query_invalid('not (width: 100px)');
     146  test_query_invalid('foo (width: 100px)');
    118147
    119148  test_container_selector_valid('foo');
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-computed-expected.txt

    r291293 r292759  
    33PASS Property container value 'inherit'
    44PASS Property container value 'unset'
    5 PASS Property container value 'inline-size'
    6 PASS Property container value 'size'
     5PASS Property container value 'none / inline-size'
     6PASS Property container value 'none / size'
    77PASS Property container value 'inline-size / inline-size'
    8 PASS Property container value 'size / block-size'
    9 FAIL Property container value 'size style / name' assert_true: 'size style / name' is a supported value for container. expected true got false
    10 FAIL Property container value 'inline-size style/ name' assert_true: 'inline-size style/ name' is a supported value for container. expected true got false
    11 PASS Property container value 'inline-size / foo'
    12 PASS Property container value 'inline-size /foo'
    13 PASS Property container value 'inline-size/ foo'
    14 PASS Property container value 'inline-size/foo'
    15 PASS Property container value 'size / FoO'
    16 PASS Property container value 'size / foo bar'
     8PASS Property container value 'block-size / size'
     9FAIL Property container value 'name / size style' assert_true: 'name / size style' is a supported value for container. expected true got false
     10FAIL Property container value 'name /inline-size style' assert_true: 'name /inline-size style' is a supported value for container. expected true got false
     11PASS Property container value 'foo / inline-size'
     12PASS Property container value 'foo /inline-size'
     13PASS Property container value 'foo/ inline-size'
     14PASS Property container value 'foo/inline-size'
     15PASS Property container value 'FoO / size'
     16PASS Property container value 'foo bar / size'
    1717
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-computed.html

    r291293 r292759  
    1515test_computed_value('container', 'inherit', 'none');
    1616test_computed_value('container', 'unset', 'none');
    17 test_computed_value('container', 'inline-size');
    18 test_computed_value('container', 'size');
     17test_computed_value('container', 'none / inline-size');
     18test_computed_value('container', 'none / size');
    1919test_computed_value('container', 'inline-size / inline-size');
    20 test_computed_value('container', 'size / block-size');
    21 test_computed_value('container', 'size style / name', 'style size / name');
    22 test_computed_value('container', 'inline-size style/ name', 'style inline-size / name');
    23 test_computed_value('container', 'inline-size / foo');
    24 test_computed_value('container', 'inline-size /foo', 'inline-size / foo');
    25 test_computed_value('container', 'inline-size/ foo', 'inline-size / foo');
    26 test_computed_value('container', 'inline-size/foo', 'inline-size / foo');
    27 test_computed_value('container', 'size / FoO', 'size / FoO');
    28 test_computed_value('container', 'size / foo bar', 'size / foo bar');
     20test_computed_value('container', 'block-size / size');
     21test_computed_value('container', 'name / size style', 'name / style size');
     22test_computed_value('container', 'name /inline-size style', 'name / style inline-size');
     23test_computed_value('container', 'foo / inline-size');
     24test_computed_value('container', 'foo /inline-size', 'foo / inline-size');
     25test_computed_value('container', 'foo/ inline-size', 'foo / inline-size');
     26test_computed_value('container', 'foo/inline-size', 'foo / inline-size');
     27test_computed_value('container', 'FoO / size');
     28test_computed_value('container', 'foo bar / size', 'foo bar / size');
    2929</script>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-name-parsing-expected.txt

    r291993 r292759  
    1010PASS e.style['container-name'] = "foo foo" should set the property value
    1111PASS e.style['container-name'] = "\\!escaped" should set the property value
     12PASS e.style['container-name'] = "not" should set the property value
    1213PASS e.style['container-name'] = "none none" should not set the property value
    1314PASS e.style['container-name'] = "foo, bar" should not set the property value
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-name-parsing.html

    r291993 r292759  
    2121test_valid_value('container-name', 'foo foo');
    2222test_valid_value('container-name', '\\!escaped');
     23test_valid_value('container-name', 'not');
    2324
    2425test_invalid_value('container-name', 'none none');
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-parsing-expected.txt

    r291293 r292759  
    55PASS e.style['container'] = "revert" should set the property value
    66PASS e.style['container'] = "none" should set the property value
    7 FAIL e.style['container'] = "none / none" should set the property value assert_equals: serialization should be canonical expected "none" but got "none / none"
     7PASS e.style['container'] = "none / none" should set the property value
    88PASS e.style['container'] = "inline-size" should set the property value
    9 FAIL e.style['container'] = "inline-size / none" should set the property value assert_equals: serialization should be canonical expected "inline-size" but got "inline-size / none"
     9PASS e.style['container'] = "none / inline-size" should set the property value
    1010PASS e.style['container'] = "size" should set the property value
    11 PASS e.style['container'] = "size / block-size" should set the property value
     11PASS e.style['container'] = "block-size / size" should set the property value
    1212PASS e.style['container'] = "inline-size / inline-size" should set the property value
    1313PASS e.style['container'] = "size / size" should set the property value
    14 FAIL e.style['container'] = "size style / none" should set the property value assert_not_equals: property should be set got disallowed value ""
    15 PASS e.style['container'] = "size / foo" should set the property value
    16 PASS e.style['container'] = "size / foo bar" should set the property value
     14FAIL e.style['container'] = "none / size style" should set the property value assert_not_equals: property should be set got disallowed value ""
     15PASS e.style['container'] = "foo" should set the property value
     16PASS e.style['container'] = "foo / none" should set the property value
     17PASS e.style['container'] = "foo bar / size" should set the property value
     18PASS e.style['container'] = "foo bar / none" should set the property value
     19PASS e.style['container'] = "FOO / size" should set the property value
     20PASS e.style['container'] = "FOO/size" should set the property value
     21PASS e.style['container'] = "  FOO  /size" should set the property value
    1722PASS e.style['container'] = "none none" should not set the property value
    1823PASS e.style['container'] = "none inline-size" should not set the property value
    19 PASS e.style['container'] = "inline-size none" should not set the property value
    20 PASS e.style['container'] = "inline-size inline-size" should not set the property value
    21 PASS e.style['container'] = "inline-size block-size unknown" should not set the property value
    22 PASS e.style['container'] = "inline-size block-size" should not set the property value
    23 PASS e.style['container'] = "size block-size" should not set the property value
     24PASS e.style['container'] = "none / inline-size none" should not set the property value
     25PASS e.style['container'] = "none / inline-size inline-size" should not set the property value
     26PASS e.style['container'] = "none / inline-size block-size unknown" should not set the property value
     27PASS e.style['container'] = "none / inline-size block-size" should not set the property value
     28PASS e.style['container'] = "none / size block-size" should not set the property value
    2429PASS e.style['container'] = "none, none" should not set the property value
    25 PASS e.style['container'] = "foo" should not set the property value
    26 PASS e.style['container'] = "foo, bar" should not set the property value
     30PASS e.style['container'] = "none / foo" should not set the property value
     31PASS e.style['container'] = "none / foo, bar" should not set the property value
    2732PASS e.style['container'] = "#fff" should not set the property value
    2833PASS e.style['container'] = "1px" should not set the property value
    2934PASS e.style['container'] = "default" should not set the property value
    30 PASS e.style['container'] = "inline-size / 10px" should not set the property value
    31 PASS e.style['container'] = "inline-size / #fefefe" should not set the property value
    32 PASS e.style['container'] = "inline-size / calc(3px)" should not set the property value
     35PASS e.style['container'] = "10px / inline-size" should not set the property value
     36PASS e.style['container'] = "#fefefe / inline-size" should not set the property value
     37PASS e.style['container'] = "calc(3px) / inline-size" should not set the property value
    3338PASS e.style['container'] = "size 1 / name" should not set the property value
    34 PASS e.style['container'] = "block-size" should not set the property value
    35 PASS e.style['container'] = "block-size / name" should not set the property value
    36 PASS e.style['container'] = "block-size /  NAME" should not set the property value
    37 PASS e.style['container'] = "block-size/NAME" should not set the property value
     39PASS e.style['container'] = "none / block-size" should not set the property value
     40PASS e.style['container'] = "name / block-size" should not set the property value
     41PASS e.style['container'] = " NAME  / block-size" should not set the property value
     42PASS e.style['container'] = "NAME/block-size" should not set the property value
    3843PASS e.style['container'] = "block-size / block-size" should not set the property value
    3944
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-parsing.html

    r291293 r292759  
    1919test_valid_value('container', 'none / none', 'none');
    2020test_valid_value('container', 'inline-size');
    21 test_valid_value('container', 'inline-size / none', 'inline-size');
     21test_valid_value('container', 'none / inline-size', 'none / inline-size');
    2222test_valid_value('container', 'size');
    23 test_valid_value('container', 'size / block-size');
     23test_valid_value('container', 'block-size / size');
    2424test_valid_value('container', 'inline-size / inline-size');
    2525test_valid_value('container', 'size / size');
    26 test_valid_value('container', 'size style / none', 'size style');
    27 test_valid_value('container', 'size / foo');
    28 test_valid_value('container', 'size / foo bar');
     26test_valid_value('container', 'none / size style', 'none / style size');
     27test_valid_value('container', 'foo');
     28test_valid_value('container', 'foo / none', 'foo');
     29test_valid_value('container', 'foo bar / size');
     30test_valid_value('container', 'foo bar / none', 'foo bar');
     31test_valid_value('container', 'FOO / size');
     32test_valid_value('container', 'FOO/size', 'FOO / size');
     33test_valid_value('container', '  FOO  /size', 'FOO / size');
    2934
    3035test_invalid_value('container', 'none none');
    3136test_invalid_value('container', 'none inline-size');
    32 test_invalid_value('container', 'inline-size none');
    33 test_invalid_value('container', 'inline-size inline-size');
    34 test_invalid_value('container', 'inline-size block-size unknown');
    35 test_invalid_value('container', 'inline-size block-size');
    36 test_invalid_value('container', 'size block-size');
     37test_invalid_value('container', 'none / inline-size none');
     38test_invalid_value('container', 'none / inline-size inline-size');
     39test_invalid_value('container', 'none / inline-size block-size unknown');
     40test_invalid_value('container', 'none / inline-size block-size');
     41test_invalid_value('container', 'none / size block-size');
    3742test_invalid_value('container', 'none, none');
    38 test_invalid_value('container', 'foo');
    39 test_invalid_value('container', 'foo, bar');
     43test_invalid_value('container', 'none / foo');
     44test_invalid_value('container', 'none / foo, bar');
    4045test_invalid_value('container', '#fff');
    4146test_invalid_value('container', '1px');
    4247test_invalid_value('container', 'default');
    43 test_invalid_value('container', 'inline-size / 10px');
    44 test_invalid_value('container', 'inline-size / #fefefe');
    45 test_invalid_value('container', 'inline-size / calc(3px)');
     48test_invalid_value('container', '10px / inline-size');
     49test_invalid_value('container', '#fefefe / inline-size');
     50test_invalid_value('container', 'calc(3px) / inline-size');
    4651test_invalid_value('container', 'size 1 / name');
    47 test_invalid_value('container', 'block-size');
    48 test_invalid_value('container', 'block-size / name');
    49 test_invalid_value('container', 'block-size /  NAME', 'block-size / NAME');
    50 test_invalid_value('container', 'block-size/NAME','block-size / NAME');
     52test_invalid_value('container', 'none / block-size');
     53test_invalid_value('container', 'name / block-size');
     54test_invalid_value('container', ' NAME  / block-size', 'NAME / block-size');
     55test_invalid_value('container', 'NAME/block-size','NAME / block-size');
    5156test_invalid_value('container', 'block-size / block-size');
    5257</script>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-selection.html

    r291036 r292759  
    2525  .size { container-type: size; }
    2626
    27   .a-inline { container:  inline-size / a; }
    28   .a-size { container:  size / a; }
     27  .a-inline { container: a / inline-size; }
     28  .a-size { container: a / size; }
    2929
    30   .b-size { container:  inline-size / b; }
    31   .b-size { container:  size / b; }
     30  .b-size { container: inline- b / size; }
     31  .b-size { container: b / size; }
    3232
    33   .ab-size { container: size / a b; }
     33  .ab-size { container: a b / size; }
    3434
    3535  .a { container-name: a; contain: strict; }
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-type-parsing.html

    r291293 r292759  
    2020test_valid_value('container-type', 'inline-size');
    2121
    22 test_valid_value('container-type', 'inline-size style');
     22test_valid_value('container-type', 'inline-size style', 'style inline-size');
    2323test_valid_value('container-type', 'style inline-size');
    2424test_valid_value('container-type', 'style size');
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/canvas-as-container-crash.html

    r291993 r292759  
    44<link rel="help" href="https://crbug.com/1289850">
    55<p>Pass if there is no crash.</p>
    6 <canvas id="canv" style="display:block;position:absolute;container:inline-size"></canvas>
     6<canvas id="canv" style="display:block;position:absolute;container-type:inline-size"></canvas>
    77<script>
    88  canv.offsetTop;
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/chrome-bug-1289718-000-crash.html

    r291993 r292759  
    22<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
    33<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1289718">
    4 <div style="container:inline-size;">
     4<div style="container-type:inline-size;">
    55  <span style="columns:2;"></span>
    66</div>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/chrome-bug-1289718-001-crash.html

    r291993 r292759  
    22<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
    33<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1289718">
    4 <div style="container:inline-size;">
     4<div style="container-type:inline-size;">
    55  <video style="columns:2;"></video>
    66</div>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/w3c-import.log

    r291993 r292759  
    1818/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/chrome-bug-1289718-000-crash.html
    1919/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/chrome-bug-1289718-001-crash.html
     20/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/chrome-quotes-crash.html
    2021/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/columns-in-table-001-crash.html
    2122/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/container-type-change-chrome-legacy-crash.html
     
    2526/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/flex-in-columns-003-crash.html
    2627/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/focus-inside-content-visibility-crash.html
     28/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/force-sibling-style-crash.html
    2729/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/grid-in-columns-000-crash.html
    2830/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/grid-in-columns-001-crash.html
  • trunk/Source/WebCore/ChangeLog

    r292754 r292759  
     12022-04-11  Antti Koivisto  <antti@apple.com>
     2
     3        [CSS Container Queries] Update container shorthand order
     4        https://bugs.webkit.org/show_bug.cgi?id=239065
     5
     6        Reviewed by Alan Bujtas.
     7
     8        The format is now 'name / type' instead of 'type / name'.
     9
     10        https://drafts.csswg.org/css-contain-3/#container-shorthand
     11
     12        * css/CSSComputedStyleDeclaration.cpp:
     13        (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
     14        * css/StyleProperties.cpp:
     15        (WebCore::isNoneValue):
     16        (WebCore::isValueID):
     17        (WebCore::StyleProperties::getPropertyValue const):
     18
     19        Also make "foo / none" serialize as "foo".
     20
     21        * css/parser/CSSParserFastPaths.cpp:
     22        (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
     23        * css/parser/CSSPropertyParser.cpp:
     24        (WebCore::consumeContainerName):
     25        (WebCore::CSSPropertyParser::consumeContainerShorthand):
     26
    1272022-04-11  Patrick Angle  <pangle@apple.com>
    228
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r292525 r292759  
    37443744        case CSSPropertyContainer: {
    37453745            auto list = CSSValueList::createSlashSeparated();
    3746             list->append(propertyValue(CSSPropertyContainerType, DoNotUpdateLayout).releaseNonNull());
    3747             if (!style.containerNames().isEmpty())
     3746            if (style.containerNames().isEmpty())
     3747                list->append(cssValuePool.createIdentifierValue(CSSValueNone));
     3748            else
    37483749                list->append(propertyValue(CSSPropertyContainerName, DoNotUpdateLayout).releaseNonNull());
     3750            if (style.containerType() != ContainerType::None)
     3751                list->append(propertyValue(CSSPropertyContainerType, DoNotUpdateLayout).releaseNonNull());
    37493752            return list;
    37503753        }
  • trunk/Source/WebCore/css/CSSProperties.json

    r292636 r292759  
    52875287            "codegen-properties": {
    52885288                "longhands": [
    5289                     "container-type",
    5290                     "container-name"
     5289                    "container-name",
     5290                    "container-type"
    52915291                ]
    52925292            },
  • trunk/Source/WebCore/css/StyleProperties.cpp

    r292467 r292759  
    6767{
    6868    return value == "initial" || value == "inherit" || value == "unset" || value == "revert";
     69}
     70
     71static bool isNoneValue(const RefPtr<CSSValue>& value)
     72{
     73    return value && value->isPrimitiveValue() && downcast<CSSPrimitiveValue>(value.get())->isValueID() && downcast<CSSPrimitiveValue>(value.get())->valueID() == CSSValueNone;
     74}
     75
     76static bool isValueID(const Ref<CSSValue>& value, CSSValueID id)
     77{
     78    return value->isPrimitiveValue() && downcast<CSSPrimitiveValue>(value.get()).isValueID() && downcast<CSSPrimitiveValue>(value.get()).valueID() == id;
     79}
     80
     81static bool isValueID(const RefPtr<CSSValue>& value, CSSValueID id)
     82{
     83    return value && isValueID(*value, id);
    6984}
    7085
     
    252267        return getShorthandValue(columnsShorthand());
    253268    case CSSPropertyContainer:
     269        if (auto type = getPropertyCSSValue(CSSPropertyContainerType)) {
     270            if (isNoneValue(type)) {
     271                if (auto name = getPropertyCSSValue(CSSPropertyContainerName))
     272                    return name->cssText();
     273                return { };
     274            }
     275        }
    254276        return getShorthandValue(containerShorthand(), " / ");
    255277    case CSSPropertyFlex:
     
    843865}
    844866
    845 static bool isNoneValue(const RefPtr<CSSValue>& value)
    846 {
    847     return value && value->isPrimitiveValue() && downcast<CSSPrimitiveValue>(value.get())->isValueID() && downcast<CSSPrimitiveValue>(value.get())->valueID() == CSSValueNone;
    848 }
    849 
    850 static bool isValueID(const Ref<CSSValue>& value, CSSValueID id)
    851 {
    852     return value->isPrimitiveValue() && downcast<CSSPrimitiveValue>(value.get()).isValueID() && downcast<CSSPrimitiveValue>(value.get()).valueID() == id;
    853 }
    854 
    855 static bool isValueID(const RefPtr<CSSValue>& value, CSSValueID id)
    856 {
    857     return value && isValueID(*value, id);
    858 }
    859 
    860867String StyleProperties::getGridTemplateValue() const
    861868{
  • trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp

    r292463 r292759  
    900900        return valueID == CSSValueAuto || valueID == CSSValueNone || valueID == CSSValueAll;
    901901    case CSSPropertyContainerType:
    902         // FIXME: Support 'style', 'state'. Those will require parsing the value as a list.
     902        // FIXME: Support 'style'. It will require parsing the value as a list.
    903903        return valueID == CSSValueNone || valueID == CSSValueSize || valueID == CSSValueInlineSize;
    904904    default:
  • trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp

    r292467 r292759  
    38633863        auto name = consumeSingleContainerName(range);
    38643864        if (!name)
    3865             return nullptr;
     3865            return list;
    38663866        list->append(name.releaseNonNull());
    38673867    } while (!range.atEnd());
     
    62126212bool CSSPropertyParser::consumeContainerShorthand(bool important)
    62136213{
    6214     auto type = parseSingleValue(CSSPropertyContainerType);
    6215     if (!type)
     6214    auto name = consumeContainerName(m_range);
     6215    if (!name)
    62166216        return false;
    62176217
    62186218    bool sawSlash = false;
    62196219
    6220     auto consumeSlashName = [&]() -> RefPtr<CSSValue> {
     6220    auto consumeSlashType = [&]() -> RefPtr<CSSValue> {
    62216221        if (m_range.atEnd())
    62226222            return nullptr;
     
    62246224            return nullptr;
    62256225        sawSlash = true;
    6226         return parseSingleValue(CSSPropertyContainerName);
     6226        return parseSingleValue(CSSPropertyContainerType);
    62276227    };
    62286228
    6229     auto name = consumeSlashName();
    6230 
    6231     if (!m_range.atEnd() || (sawSlash && !name))
     6229    auto type = consumeSlashType();
     6230
     6231    if (!m_range.atEnd() || (sawSlash && !type))
    62326232        return false;
    62336233
    6234     addProperty(CSSPropertyContainerType, CSSPropertyContainer, type.releaseNonNull(), important);
    6235     addPropertyWithImplicitDefault(CSSPropertyContainerName, CSSPropertyContainer, WTFMove(name), CSSValuePool::singleton().createImplicitInitialValue(), important);
     6234    addProperty(CSSPropertyContainerName, CSSPropertyContainer, name.releaseNonNull(), important);
     6235    addPropertyWithImplicitDefault(CSSPropertyContainerType, CSSPropertyContainer, WTFMove(type), CSSValuePool::singleton().createImplicitInitialValue(), important);
    62366236    return true;
    62376237}
Note: See TracChangeset for help on using the changeset viewer.