Changeset 228095 in webkit


Ignore:
Timestamp:
Feb 5, 2018 5:51:24 AM (6 years ago)
Author:
Manuel Rego Casasnovas
Message:

[css-grid] Rename gutter properties to remove "grid-" prefix
https://bugs.webkit.org/show_bug.cgi?id=180290

Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

Imported WPT tests from css/css-align/gaps/.
And also update the tests on css/css-grid/alignment/ gutter tests.

  • web-platform-tests/css/css-align/gaps/column-gap-animation-001-expected.txt: Added.
  • web-platform-tests/css/css-align/gaps/column-gap-animation-001.html: Added.
  • web-platform-tests/css/css-align/gaps/column-gap-animation-002-expected.txt: Added.
  • web-platform-tests/css/css-align/gaps/column-gap-animation-002.html: Added.
  • web-platform-tests/css/css-align/gaps/column-gap-animation-003-expected.txt: Added.
  • web-platform-tests/css/css-align/gaps/column-gap-animation-003.html: Added.
  • web-platform-tests/css/css-align/gaps/column-gap-parsing-001-expected.txt: Added.
  • web-platform-tests/css/css-align/gaps/column-gap-parsing-001.html: Added.
  • web-platform-tests/css/css-align/gaps/gap-animation-001-expected.txt: Added.
  • web-platform-tests/css/css-align/gaps/gap-animation-001.html: Added.
  • web-platform-tests/css/css-align/gaps/gap-animation-002-expected.txt: Added.
  • web-platform-tests/css/css-align/gaps/gap-animation-002.html: Added.
  • web-platform-tests/css/css-align/gaps/gap-animation-003-expected.txt: Added.
  • web-platform-tests/css/css-align/gaps/gap-animation-003.html: Added.
  • web-platform-tests/css/css-align/gaps/gap-animation-004-expected.txt: Added.
  • web-platform-tests/css/css-align/gaps/gap-animation-004.html: Added.
  • web-platform-tests/css/css-align/gaps/gap-parsing-001-expected.txt: Added.
  • web-platform-tests/css/css-align/gaps/gap-parsing-001.html: Added.
  • web-platform-tests/css/css-align/gaps/grid-column-gap-parsing-001-expected.txt: Added.
  • web-platform-tests/css/css-align/gaps/grid-column-gap-parsing-001.html: Added.
  • web-platform-tests/css/css-align/gaps/grid-gap-parsing-001-expected.txt: Added.
  • web-platform-tests/css/css-align/gaps/grid-gap-parsing-001.html: Added.
  • web-platform-tests/css/css-align/gaps/grid-row-gap-parsing-001-expected.txt: Added.
  • web-platform-tests/css/css-align/gaps/grid-row-gap-parsing-001.html: Added.
  • web-platform-tests/css/css-align/gaps/row-gap-animation-001-expected.txt: Added.
  • web-platform-tests/css/css-align/gaps/row-gap-animation-001.html: Added.
  • web-platform-tests/css/css-align/gaps/row-gap-animation-002-expected.txt: Added.
  • web-platform-tests/css/css-align/gaps/row-gap-animation-002.html: Added.
  • web-platform-tests/css/css-align/gaps/row-gap-animation-003-expected.txt: Added.
  • web-platform-tests/css/css-align/gaps/row-gap-animation-003.html: Added.
  • web-platform-tests/css/css-align/gaps/row-gap-parsing-001-expected.txt: Added.
  • web-platform-tests/css/css-align/gaps/row-gap-parsing-001.html: Added.
  • web-platform-tests/css/css-align/gaps/w3c-import.log: Added.
  • web-platform-tests/css/css-grid/alignment/grid-gutters-001-expected.html:
  • web-platform-tests/css/css-grid/alignment/grid-gutters-002-expected.html:
  • web-platform-tests/css/css-grid/alignment/grid-gutters-003-expected.html:
  • web-platform-tests/css/css-grid/alignment/grid-gutters-004-expected.html:
  • web-platform-tests/css/css-grid/alignment/grid-gutters-005-expected.html:
  • web-platform-tests/css/css-grid/alignment/grid-gutters-006-expected.html:
  • web-platform-tests/css/css-grid/alignment/grid-gutters-007-expected.html:
  • web-platform-tests/css/css-grid/alignment/grid-gutters-008-expected.html:
  • web-platform-tests/css/css-grid/alignment/grid-gutters-009-expected.html:
  • web-platform-tests/css/css-grid/alignment/grid-gutters-010-expected.html:

Source/WebCore:

This patch applies the resoultion of the CSS WG to unprefix
the CSS Grid Layout gutter properties:
https://github.com/w3c/csswg-drafts/issues/1696

column-gap already existed before, as it's part of Multicol.
The patch adds the new properties row-gap and gap, and keep the legacy ones
as aliases:

  • grid-column-gap => column-gap
  • grid-row-gap => row-gap
  • grid-gap => gap

As column-gap was already animatable, this change takes advantage
to make animatable row-gap too.

Tests: imported/w3c/web-platform-tests/css/css-align/gaps/

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):

  • css/CSSProperties.json:
  • css/StyleProperties.cpp:
  • css/parser/CSSParserFastPaths.cpp:

(WebCore::isSimpleLengthPropertyID):

  • css/parser/CSSPropertyParser.cpp:

(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseShorthand):

  • page/animation/CSSPropertyAnimation.cpp:

(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):

  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::availableSpaceForGutters const):
(WebCore::RenderGrid::gridGap const):

  • rendering/style/RenderStyle.h:

(WebCore::RenderStyle::gridAutoRows const):
(WebCore::RenderStyle::columnGap const):
(WebCore::RenderStyle::rowGap const):
(WebCore::RenderStyle::setGridItemRowEnd):
(WebCore::RenderStyle::setColumnGap):
(WebCore::RenderStyle::setRowGap):
(WebCore::RenderStyle::initialRowGap):

  • rendering/style/StyleGridData.cpp:

(WebCore::StyleGridData::StyleGridData):

  • rendering/style/StyleGridData.h:

(WebCore::StyleGridData::operator== const):

  • rendering/style/StyleMultiColData.cpp:

(WebCore::StyleMultiColData::StyleMultiColData):
(WebCore::StyleMultiColData::operator== const):

  • rendering/style/StyleMultiColData.h:
  • rendering/style/StyleRareNonInheritedData.cpp:

(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):

  • rendering/style/StyleRareNonInheritedData.h:

LayoutTests:

so removing them from TestExpectations.

  • fast/css-grid-layout/grid-gutters-get-set.html: Removed. This is now covered by WPT tests.
  • fast/css-grid-layout/grid-shorthand-get-set-expected.txt: Update results for gutter properties

as default value is now "normal".

  • fast/css-grid-layout/grid-shorthand-get-set.html: Update checks for gutter properties

as default value is now "normal".

Location:
trunk
Files:
34 added
1 deleted
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r228092 r228095  
     12018-02-05  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [css-grid] Rename gutter properties to remove "grid-" prefix
     4        https://bugs.webkit.org/show_bug.cgi?id=180290
     5
     6        Reviewed by Javier Fernandez.
     7
     8        * TestExpectations: We're now passing some gutters tests,
     9        so removing them from TestExpectations.
     10        * fast/css-grid-layout/grid-gutters-get-set.html: Removed. This is now covered by WPT tests.
     11        * fast/css-grid-layout/grid-shorthand-get-set-expected.txt: Update results for gutter properties
     12        as default value is now "normal".
     13        * fast/css-grid-layout/grid-shorthand-get-set.html: Update checks for gutter properties
     14        as default value is now "normal".
     15
    1162018-02-05  Ms2ger  <Ms2ger@igalia.com>
    217
  • trunk/LayoutTests/TestExpectations

    r227978 r228095  
    493493webkit.org/b/165062 fast/css-grid-layout/grid-baseline-margins.html [ ImageOnlyFailure ]
    494494webkit.org/b/169271 imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-sizing-alignment-001.html [ ImageOnlyFailure ]
    495 webkit.org/b/180290 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-001.html [ ImageOnlyFailure ]
    496 webkit.org/b/180290 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-002.html [ ImageOnlyFailure ]
    497 webkit.org/b/180290 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-003.html [ ImageOnlyFailure ]
    498 webkit.org/b/180290 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-004.html [ ImageOnlyFailure ]
    499 webkit.org/b/180290 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-005.html [ ImageOnlyFailure ]
    500 webkit.org/b/180290 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-006.html [ ImageOnlyFailure ]
    501 webkit.org/b/180290 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-007.html [ ImageOnlyFailure ]
    502 webkit.org/b/180290 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-008.html [ ImageOnlyFailure ]
    503 webkit.org/b/180290 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-009.html [ ImageOnlyFailure ]
    504 webkit.org/b/180290 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-010.html [ ImageOnlyFailure ]
    505495imported/w3c/web-platform-tests/css/css-grid/abspos/absolute-positioning-changing-containing-block-001.html [ ImageOnlyFailure ]
    506496imported/w3c/web-platform-tests/css/css-grid/abspos/grid-item-absolute-positioning-dynamic-001.html [ ImageOnlyFailure ]
  • trunk/LayoutTests/fast/css-grid-layout/grid-shorthand-get-set-expected.txt

    r221668 r228095  
    333333
    334334Test the inherit value does not affect gutter properties (grid-*-gap)
    335 PASS getComputedStyle(anotherElement, '').getPropertyValue('grid-column-gap') is "0px"
    336 PASS getComputedStyle(anotherElement, '').getPropertyValue('grid-row-gap') is "0px"
    337 PASS getComputedStyle(anotherElement, '').getPropertyValue('grid-column-gap') is "0px"
    338 PASS getComputedStyle(anotherElement, '').getPropertyValue('grid-row-gap') is "0px"
     335PASS getComputedStyle(anotherElement, '').getPropertyValue('grid-column-gap') is "normal"
     336PASS getComputedStyle(anotherElement, '').getPropertyValue('grid-row-gap') is "normal"
     337PASS getComputedStyle(anotherElement, '').getPropertyValue('grid-column-gap') is "normal"
     338PASS getComputedStyle(anotherElement, '').getPropertyValue('grid-row-gap') is "normal"
    339339PASS successfullyParsed is true
    340340
  • trunk/LayoutTests/fast/css-grid-layout/grid-shorthand-get-set.html

    r221668 r228095  
    211211    var anotherElement = document.createElement("div");
    212212    document.body.appendChild(anotherElement);
    213     shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue('grid-column-gap')", "0px");
    214     shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue('grid-row-gap')", "0px");
     213    shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue('grid-column-gap')", "normal");
     214    shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue('grid-row-gap')", "normal");
    215215    anotherElement.style.grid = "inherit";
    216     shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue('grid-column-gap')", "0px");
    217     shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue('grid-row-gap')", "0px");
     216    shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue('grid-column-gap')", "normal");
     217    shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue('grid-row-gap')", "normal");
    218218</script>
    219219</body>
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r228092 r228095  
     12018-02-05  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [css-grid] Rename gutter properties to remove "grid-" prefix
     4        https://bugs.webkit.org/show_bug.cgi?id=180290
     5
     6        Reviewed by Javier Fernandez.
     7
     8        Imported WPT tests from css/css-align/gaps/.
     9        And also update the tests on css/css-grid/alignment/ gutter tests.
     10
     11        * web-platform-tests/css/css-align/gaps/column-gap-animation-001-expected.txt: Added.
     12        * web-platform-tests/css/css-align/gaps/column-gap-animation-001.html: Added.
     13        * web-platform-tests/css/css-align/gaps/column-gap-animation-002-expected.txt: Added.
     14        * web-platform-tests/css/css-align/gaps/column-gap-animation-002.html: Added.
     15        * web-platform-tests/css/css-align/gaps/column-gap-animation-003-expected.txt: Added.
     16        * web-platform-tests/css/css-align/gaps/column-gap-animation-003.html: Added.
     17        * web-platform-tests/css/css-align/gaps/column-gap-parsing-001-expected.txt: Added.
     18        * web-platform-tests/css/css-align/gaps/column-gap-parsing-001.html: Added.
     19        * web-platform-tests/css/css-align/gaps/gap-animation-001-expected.txt: Added.
     20        * web-platform-tests/css/css-align/gaps/gap-animation-001.html: Added.
     21        * web-platform-tests/css/css-align/gaps/gap-animation-002-expected.txt: Added.
     22        * web-platform-tests/css/css-align/gaps/gap-animation-002.html: Added.
     23        * web-platform-tests/css/css-align/gaps/gap-animation-003-expected.txt: Added.
     24        * web-platform-tests/css/css-align/gaps/gap-animation-003.html: Added.
     25        * web-platform-tests/css/css-align/gaps/gap-animation-004-expected.txt: Added.
     26        * web-platform-tests/css/css-align/gaps/gap-animation-004.html: Added.
     27        * web-platform-tests/css/css-align/gaps/gap-parsing-001-expected.txt: Added.
     28        * web-platform-tests/css/css-align/gaps/gap-parsing-001.html: Added.
     29        * web-platform-tests/css/css-align/gaps/grid-column-gap-parsing-001-expected.txt: Added.
     30        * web-platform-tests/css/css-align/gaps/grid-column-gap-parsing-001.html: Added.
     31        * web-platform-tests/css/css-align/gaps/grid-gap-parsing-001-expected.txt: Added.
     32        * web-platform-tests/css/css-align/gaps/grid-gap-parsing-001.html: Added.
     33        * web-platform-tests/css/css-align/gaps/grid-row-gap-parsing-001-expected.txt: Added.
     34        * web-platform-tests/css/css-align/gaps/grid-row-gap-parsing-001.html: Added.
     35        * web-platform-tests/css/css-align/gaps/row-gap-animation-001-expected.txt: Added.
     36        * web-platform-tests/css/css-align/gaps/row-gap-animation-001.html: Added.
     37        * web-platform-tests/css/css-align/gaps/row-gap-animation-002-expected.txt: Added.
     38        * web-platform-tests/css/css-align/gaps/row-gap-animation-002.html: Added.
     39        * web-platform-tests/css/css-align/gaps/row-gap-animation-003-expected.txt: Added.
     40        * web-platform-tests/css/css-align/gaps/row-gap-animation-003.html: Added.
     41        * web-platform-tests/css/css-align/gaps/row-gap-parsing-001-expected.txt: Added.
     42        * web-platform-tests/css/css-align/gaps/row-gap-parsing-001.html: Added.
     43        * web-platform-tests/css/css-align/gaps/w3c-import.log: Added.
     44        * web-platform-tests/css/css-grid/alignment/grid-gutters-001-expected.html:
     45        * web-platform-tests/css/css-grid/alignment/grid-gutters-002-expected.html:
     46        * web-platform-tests/css/css-grid/alignment/grid-gutters-003-expected.html:
     47        * web-platform-tests/css/css-grid/alignment/grid-gutters-004-expected.html:
     48        * web-platform-tests/css/css-grid/alignment/grid-gutters-005-expected.html:
     49        * web-platform-tests/css/css-grid/alignment/grid-gutters-006-expected.html:
     50        * web-platform-tests/css/css-grid/alignment/grid-gutters-007-expected.html:
     51        * web-platform-tests/css/css-grid/alignment/grid-gutters-008-expected.html:
     52        * web-platform-tests/css/css-grid/alignment/grid-gutters-009-expected.html:
     53        * web-platform-tests/css/css-grid/alignment/grid-gutters-010-expected.html:
     54
    1552018-02-05  Ms2ger  <Ms2ger@igalia.com>
    256
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-001-expected.html

    r225561 r228095  
    3939</style>
    4040
     41<p>The test passes if it has the same visual effect as reference.</p>
    4142<div id="grid">
    4243    <div></div>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-002-expected.html

    r225561 r228095  
    3939</style>
    4040
     41<p>The test passes if it has the same visual effect as reference.</p>
    4142<div id="grid">
    4243    <div></div>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-003-expected.html

    r225561 r228095  
    3939</style>
    4040
     41<p>The test passes if it has the same visual effect as reference.</p>
    4142<div id="grid">
    4243    <div></div>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-004-expected.html

    r225561 r228095  
    3939</style>
    4040
     41<p>The test passes if it has the same visual effect as reference.</p>
    4142<div id="grid">
    4243    <div></div>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-005-expected.html

    r225561 r228095  
    3939</style>
    4040
     41<p>The test passes if it has the same visual effect as reference.</p>
    4142<div id="grid">
    4243    <div></div>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-006-expected.html

    r225561 r228095  
    3939</style>
    4040
     41<p>The test passes if it has the same visual effect as reference.</p>
    4142<div id="grid">
    4243    <div></div>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-007-expected.html

    r225561 r228095  
    3939</style>
    4040
     41<p>The test passes if it has the same visual effect as reference.</p>
    4142<div id="grid">
    4243    <div></div>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-008-expected.html

    r225561 r228095  
    3939</style>
    4040
     41<p>The test passes if it has the same visual effect as reference.</p>
    4142<div id="grid">
    4243    <div></div>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-009-expected.html

    r225561 r228095  
    3939</style>
    4040
     41<p>The test passes if it has the same visual effect as reference. Column gap should be percentage of width. Row gap should resolve to auto, and therefore collapse to 0 height.</p>
    4142<div id="grid">
    4243    <div></div>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-010-expected.html

    r225561 r228095  
    3939</style>
    4040
     41<p>The test passes if it has the same visual effect as reference. Column gap should be percentage of width. Row gap should resolve to auto, and therefore collapse to 0 height.</p>
    4142<div id="grid">
    4243    <div></div>
  • trunk/Source/WebCore/ChangeLog

    r228092 r228095  
     12018-02-05  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [css-grid] Rename gutter properties to remove "grid-" prefix
     4        https://bugs.webkit.org/show_bug.cgi?id=180290
     5
     6        Reviewed by Javier Fernandez.
     7
     8        This patch applies the resoultion of the CSS WG to unprefix
     9        the CSS Grid Layout gutter properties:
     10        https://github.com/w3c/csswg-drafts/issues/1696
     11
     12        column-gap already existed before, as it's part of Multicol.
     13        The patch adds the new properties row-gap and gap, and keep the legacy ones
     14        as aliases:
     15        - grid-column-gap => column-gap
     16        - grid-row-gap => row-gap
     17        - grid-gap => gap
     18
     19        As column-gap was already animatable, this change takes advantage
     20        to make animatable row-gap too.
     21
     22        Tests: imported/w3c/web-platform-tests/css/css-align/gaps/
     23
     24        * css/CSSComputedStyleDeclaration.cpp:
     25        (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
     26        * css/CSSProperties.json:
     27        * css/StyleProperties.cpp:
     28        * css/parser/CSSParserFastPaths.cpp:
     29        (WebCore::isSimpleLengthPropertyID):
     30        * css/parser/CSSPropertyParser.cpp:
     31        (WebCore::CSSPropertyParser::parseSingleValue):
     32        (WebCore::CSSPropertyParser::parseShorthand):
     33        * page/animation/CSSPropertyAnimation.cpp:
     34        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
     35        * rendering/RenderGrid.cpp:
     36        (WebCore::RenderGrid::availableSpaceForGutters const):
     37        (WebCore::RenderGrid::gridGap const):
     38        * rendering/style/RenderStyle.h:
     39        (WebCore::RenderStyle::gridAutoRows const):
     40        (WebCore::RenderStyle::columnGap const):
     41        (WebCore::RenderStyle::rowGap const):
     42        (WebCore::RenderStyle::setGridItemRowEnd):
     43        (WebCore::RenderStyle::setColumnGap):
     44        (WebCore::RenderStyle::setRowGap):
     45        (WebCore::RenderStyle::initialRowGap):
     46        * rendering/style/StyleGridData.cpp:
     47        (WebCore::StyleGridData::StyleGridData):
     48        * rendering/style/StyleGridData.h:
     49        (WebCore::StyleGridData::operator== const):
     50        * rendering/style/StyleMultiColData.cpp:
     51        (WebCore::StyleMultiColData::StyleMultiColData):
     52        (WebCore::StyleMultiColData::operator== const):
     53        * rendering/style/StyleMultiColData.h:
     54        * rendering/style/StyleRareNonInheritedData.cpp:
     55        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
     56        (WebCore::StyleRareNonInheritedData::operator== const):
     57        * rendering/style/StyleRareNonInheritedData.h:
     58
    1592018-02-05  Ms2ger  <Ms2ger@igalia.com>
    260
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r227676 r228095  
    298298    CSSPropertyColumnFill,
    299299    CSSPropertyColumnGap,
     300    CSSPropertyRowGap,
    300301    CSSPropertyWebkitColumnProgression,
    301302    CSSPropertyColumnRuleColor,
     
    350351    CSSPropertyGridRowEnd,
    351352    CSSPropertyGridRowStart,
    352     CSSPropertyGridColumnGap,
    353     CSSPropertyGridRowGap,
    354353    CSSPropertyWebkitHyphenateCharacter,
    355354    CSSPropertyWebkitHyphenateLimitAfter,
     
    29302929                return cssValuePool.createIdentifierValue(CSSValueNormal);
    29312930            return zoomAdjustedPixelValueForLength(style.columnGap().length(), style);
     2931        case CSSPropertyRowGap:
     2932            if (style.rowGap().isNormal())
     2933                return cssValuePool.createIdentifierValue(CSSValueNormal);
     2934            return zoomAdjustedPixelValueForLength(style.rowGap().length(), style);
    29322935        case CSSPropertyWebkitColumnProgression:
    29332936            return cssValuePool.createValue(style.columnProgression());
     
    31123115            }
    31133116            return CSSGridTemplateAreasValue::create(style.namedGridArea(), style.namedGridAreaRowCount(), style.namedGridAreaColumnCount());
    3114         case CSSPropertyGridColumnGap:
    3115             return zoomAdjustedPixelValueForLength(style.gridColumnGap(), style);
    3116         case CSSPropertyGridRowGap:
    3117             return zoomAdjustedPixelValueForLength(style.gridRowGap(), style);
    3118         case CSSPropertyGridGap:
    3119             return getCSSPropertyValuesForGridShorthand(gridGapShorthand());
     3117        case CSSPropertyGap:
     3118            return getCSSPropertyValuesForShorthandProperties(gapShorthand());
    31203119        case CSSPropertyHeight:
    31213120            if (renderer && !renderer->isRenderSVGModelObject()) {
  • trunk/Source/WebCore/css/CSSProperties.json

    r227676 r228095  
    43054305            "codegen-properties": {
    43064306                "aliases": [
     4307                    "grid-column-gap",
    43074308                    "-webkit-column-gap"
    43084309                ],
     
    43104311            },
    43114312            "specification":  {
    4312                 "category": "css-multicol",
    4313                 "url": "https://drafts.csswg.org/css-multicol/#column-gap"
     4313                "category": "css-align",
     4314                "url": "https://drafts.csswg.org/css-align/#column-row-gap"
     4315            }
     4316        },
     4317        "row-gap": {
     4318            "codegen-properties": {
     4319                "aliases": [
     4320                    "grid-row-gap"
     4321                ],
     4322                "converter": "GapLength"
     4323            },
     4324            "specification": {
     4325                "category": "css-align",
     4326                "url": "https://drafts.csswg.org/css-align/#column-row-gap"
     4327            }
     4328        },
     4329        "gap": {
     4330            "codegen-properties": {
     4331                "aliases": [
     4332                    "grid-gap"
     4333                ],
     4334                "longhands": [
     4335                    "row-gap",
     4336                    "column-gap"
     4337                ]
     4338            },
     4339            "specification": {
     4340                "category": "css-align",
     4341                "url": "https://drafts.csswg.org/css-align/#gap-shorthand"
    43144342            }
    43154343        },
     
    48134841            }
    48144842        },
    4815         "grid-column-gap": {
    4816             "codegen-properties": {
    4817                 "initial": "initialZeroLength",
    4818                 "converter": "Length"
    4819             },
    4820             "specification": {
    4821                 "category": "css-grid",
    4822                 "url": "https://www.w3.org/TR/css-grid-1/#propdef-grid-column-gap"
    4823             }
    4824         },
    48254843        "grid-column-start": {
    48264844            "codegen-properties": {
     
    48744892            }
    48754893        },
    4876         "grid-row-gap": {
    4877             "codegen-properties": {
    4878                 "initial": "initialZeroLength",
    4879                 "converter": "Length"
    4880             },
    4881             "specification": {
    4882                 "category": "css-grid",
    4883                 "url": "https://www.w3.org/TR/css-grid-1/#propdef-grid-row-gap"
    4884             }
    4885         },
    48864894        "grid-row-start": {
    48874895            "codegen-properties": {
     
    49044912                "category": "css-grid",
    49054913                "url": "https://www.w3.org/TR/css-grid-1/#propdef-grid-column"
    4906             }
    4907         },
    4908         "grid-gap": {
    4909             "codegen-properties": {
    4910                 "longhands": [
    4911                     "grid-row-gap",
    4912                     "grid-column-gap"
    4913                 ]
    4914             },
    4915             "specification": {
    4916                 "category": "css-grid",
    4917                 "url": "https://www.w3.org/TR/css-grid-1/#propdef-grid-gap"
    49184914            }
    49194915        },
  • trunk/Source/WebCore/css/StyleProperties.cpp

    r224320 r228095  
    11801180    CSSPropertyColumnCount,
    11811181    CSSPropertyColumnGap,
     1182    CSSPropertyRowGap,
    11821183    CSSPropertyColumnRuleColor,
    11831184    CSSPropertyColumnRuleStyle,
  • trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp

    r226432 r228095  
    4848    switch (propertyId) {
    4949    case CSSPropertyFontSize:
    50     case CSSPropertyGridColumnGap:
    51     case CSSPropertyGridRowGap:
    5250    case CSSPropertyHeight:
    5351    case CSSPropertyWidth:
  • trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp

    r227786 r228095  
    40364036    case CSSPropertyColumnGap:
    40374037        return consumeGapLength(m_range, m_context.mode);
     4038    case CSSPropertyRowGap:
     4039        return consumeGapLength(m_range, m_context.mode);
    40384040    case CSSPropertyColumnSpan:
    40394041        return consumeColumnSpan(m_range);
     
    40564058#endif
    40574059        return consumeAnimationPropertyList(property, m_range, m_context);
    4058     case CSSPropertyGridColumnGap:
    4059     case CSSPropertyGridRowGap:
    4060         return consumeLengthOrPercent(m_range, m_context.mode, ValueRangeNonNegative);
    40614060    case CSSPropertyShapeMargin:
    40624061        return consumeLengthOrPercent(m_range, m_context.mode, ValueRangeNonNegative);
     
    57865785    case CSSPropertyPerspectiveOrigin:
    57875786        return consumePerspectiveOrigin(important);
    5788     case CSSPropertyGridGap: {
    5789         RefPtr<CSSValue> rowGap = consumeLengthOrPercent(m_range, m_context.mode, ValueRangeNonNegative);
    5790         RefPtr<CSSValue> columnGap = consumeLengthOrPercent(m_range, m_context.mode, ValueRangeNonNegative);
     5787    case CSSPropertyGap: {
     5788        RefPtr<CSSValue> rowGap = consumeGapLength(m_range, m_context.mode);
     5789        RefPtr<CSSValue> columnGap = consumeGapLength(m_range, m_context.mode);
    57915790        if (!rowGap || !m_range.atEnd())
    57925791            return false;
    57935792        if (!columnGap)
    57945793            columnGap = rowGap;
    5795         addProperty(CSSPropertyGridRowGap, CSSPropertyGridGap, rowGap.releaseNonNull(), important);
    5796         addProperty(CSSPropertyGridColumnGap, CSSPropertyGridGap, columnGap.releaseNonNull(), important);
     5794        addProperty(CSSPropertyRowGap, CSSPropertyGap, rowGap.releaseNonNull(), important);
     5795        addProperty(CSSPropertyColumnGap, CSSPropertyGap, columnGap.releaseNonNull(), important);
    57975796        return true;
    57985797    }
  • trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp

    r227676 r228095  
    15271527        new PropertyWrapper<unsigned short>(CSSPropertyColumnRuleWidth, &RenderStyle::columnRuleWidth, &RenderStyle::setColumnRuleWidth),
    15281528        new LengthPropertyWrapper<GapLength>(CSSPropertyColumnGap, &RenderStyle::columnGap, &RenderStyle::setColumnGap),
     1529        new LengthPropertyWrapper<GapLength>(CSSPropertyRowGap, &RenderStyle::rowGap, &RenderStyle::setRowGap),
    15291530        new PropertyWrapper<unsigned short>(CSSPropertyColumnCount, &RenderStyle::columnCount, &RenderStyle::setColumnCount),
    15301531        new PropertyWrapper<float>(CSSPropertyColumnWidth, &RenderStyle::columnWidth, &RenderStyle::setColumnWidth),
  • trunk/Source/WebCore/rendering/RenderGrid.cpp

    r227977 r228095  
    171171{
    172172    bool isRowAxis = direction == ForColumns;
    173     const Length& gap = isRowAxis ? style().gridColumnGap() : style().gridRowGap();
    174     if (!gap.isPercent())
     173    const GapLength& gapLength = isRowAxis ? style().columnGap() : style().rowGap();
     174    if (gapLength.isNormal() || !gapLength.length().isPercent())
    175175        return std::nullopt;
    176176
     
    340340LayoutUnit RenderGrid::gridGap(GridTrackSizingDirection direction, std::optional<LayoutUnit> availableSize) const
    341341{
    342     const Length& gap = direction == ForColumns ? style().gridColumnGap() : style().gridRowGap();
    343     return valueForLength(gap, availableSize.value_or(0));
     342    const GapLength& gapLength = direction == ForColumns? style().columnGap() : style().rowGap();
     343    if (gapLength.isNormal())
     344        return LayoutUnit();
     345
     346    return valueForLength(gapLength.length(), availableSize.value_or(0));
    344347}
    345348
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r227676 r228095  
    552552    const Vector<GridTrackSize>& gridAutoColumns() const { return m_rareNonInheritedData->grid->gridAutoColumns; }
    553553    const Vector<GridTrackSize>& gridAutoRows() const { return m_rareNonInheritedData->grid->gridAutoRows; }
    554     const Length& gridColumnGap() const { return m_rareNonInheritedData->grid->gridColumnGap; }
    555     const Length& gridRowGap() const { return m_rareNonInheritedData->grid->gridRowGap; }
    556554
    557555    const GridPosition& gridItemColumnStart() const { return m_rareNonInheritedData->gridItem->gridColumnStart; }
     
    606604    bool specifiesColumns() const { return !hasAutoColumnCount() || !hasAutoColumnWidth() || !hasInlineColumnAxis(); }
    607605    ColumnFill columnFill() const { return static_cast<ColumnFill>(m_rareNonInheritedData->multiCol->fill); }
    608     const GapLength& columnGap() const { return m_rareNonInheritedData->multiCol->columnGap; }
     606    const GapLength& columnGap() const { return m_rareNonInheritedData->columnGap; }
     607    const GapLength& rowGap() const { return m_rareNonInheritedData->rowGap; }
    609608    EBorderStyle columnRuleStyle() const { return m_rareNonInheritedData->multiCol->rule.style(); }
    610609    unsigned short columnRuleWidth() const { return m_rareNonInheritedData->multiCol->ruleWidth(); }
     
    10981097    void setGridItemRowStart(const GridPosition& rowStartPosition) { SET_NESTED_VAR(m_rareNonInheritedData, gridItem, gridRowStart, rowStartPosition); }
    10991098    void setGridItemRowEnd(const GridPosition& rowEndPosition) { SET_NESTED_VAR(m_rareNonInheritedData, gridItem, gridRowEnd, rowEndPosition); }
    1100     void setGridColumnGap(Length&& length) { SET_NESTED_VAR(m_rareNonInheritedData, grid, gridColumnGap, WTFMove(length)); }
    1101     void setGridRowGap(Length&& length) { SET_NESTED_VAR(m_rareNonInheritedData, grid, gridRowGap, WTFMove(length)); }
    11021099
    11031100    void setMarqueeIncrement(Length&& length) { SET_NESTED_VAR(m_rareNonInheritedData, marquee, increment, WTFMove(length)); }
     
    11301127    void setHasAutoColumnCount() { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, autoCount, true); SET_NESTED_VAR(m_rareNonInheritedData, multiCol, count, 0); }
    11311128    void setColumnFill(ColumnFill columnFill) { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, fill, columnFill); }
    1132     void setColumnGap(GapLength&& gapLength) { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, columnGap, WTFMove(gapLength)); }
     1129    void setColumnGap(GapLength&& gapLength) { SET_VAR(m_rareNonInheritedData, columnGap, WTFMove(gapLength)); }
     1130    void setRowGap(GapLength&& gapLength) { SET_VAR(m_rareNonInheritedData, rowGap, WTFMove(gapLength)); }
    11331131    void setColumnRuleColor(const Color& c) { SET_BORDERVALUE_COLOR(m_rareNonInheritedData.access().multiCol, rule, c); }
    11341132    void setColumnRuleStyle(EBorderStyle b) { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, rule.m_style, b); }
     
    15341532    static ColumnSpan initialColumnSpan() { return ColumnSpanNone; }
    15351533    static GapLength initialColumnGap() { return GapLength(); }
     1534    static GapLength initialRowGap() { return GapLength(); }
    15361535    static const TransformOperations& initialTransform() { static NeverDestroyed<TransformOperations> ops; return ops; }
    15371536    static Length initialTransformOriginX() { return Length(50.0f, Percent); }
     
    16261625    static OrderedNamedGridLinesMap initialOrderedNamedGridRowLines() { return OrderedNamedGridLinesMap(); }
    16271626
    1628     static Length initialGridColumnGap() { return Length(Fixed); }
    1629     static Length initialGridRowGap() { return Length(Fixed); }
    1630 
    16311627    // 'auto' is the default.
    16321628    static GridPosition initialGridItemColumnStart() { return GridPosition(); }
  • trunk/Source/WebCore/rendering/style/StyleGridData.cpp

    r212629 r228095  
    4848    , namedGridAreaRowCount(RenderStyle::initialNamedGridAreaCount())
    4949    , namedGridAreaColumnCount(RenderStyle::initialNamedGridAreaCount())
    50     , gridColumnGap(RenderStyle::initialGridColumnGap())
    51     , gridRowGap(RenderStyle::initialGridRowGap())
    5250    , gridAutoRepeatColumns(RenderStyle::initialGridAutoRepeatTracks())
    5351    , gridAutoRepeatRows(RenderStyle::initialGridAutoRepeatTracks())
     
    7775    , namedGridAreaRowCount(o.namedGridAreaRowCount)
    7876    , namedGridAreaColumnCount(o.namedGridAreaColumnCount)
    79     , gridColumnGap(o.gridColumnGap)
    80     , gridRowGap(o.gridRowGap)
    8177    , gridAutoRepeatColumns(o.gridAutoRepeatColumns)
    8278    , gridAutoRepeatRows(o.gridAutoRepeatRows)
  • trunk/Source/WebCore/rendering/style/StyleGridData.h

    r212629 r228095  
    5555            && namedGridAreaRowCount == o.namedGridAreaRowCount && namedGridAreaColumnCount == o.namedGridAreaColumnCount
    5656            && orderedNamedGridRowLines == o.orderedNamedGridRowLines && orderedNamedGridColumnLines == o.orderedNamedGridColumnLines
    57             && gridColumnGap == o.gridColumnGap && gridRowGap == o.gridRowGap
    5857            && gridAutoRepeatColumns == o.gridAutoRepeatColumns && gridAutoRepeatRows == o.gridAutoRepeatRows
    5958            && autoRepeatColumnsInsertionPoint == o.autoRepeatColumnsInsertionPoint && autoRepeatRowsInsertionPoint == o.autoRepeatRowsInsertionPoint
     
    9190    unsigned namedGridAreaColumnCount;
    9291
    93     Length gridColumnGap;
    94     Length gridRowGap;
    95 
    9692    Vector<GridTrackSize> gridAutoRepeatColumns;
    9793    Vector<GridTrackSize> gridAutoRepeatRows;
  • trunk/Source/WebCore/rendering/style/StyleMultiColData.cpp

    r227676 r228095  
    4242    , width(other.width)
    4343    , count(other.count)
    44     , columnGap(other.columnGap)
    4544    , rule(other.rule)
    4645    , visitedLinkColumnRuleColor(other.visitedLinkColumnRuleColor)
     
    6160bool StyleMultiColData::operator==(const StyleMultiColData& other) const
    6261{
    63     return width == other.width && count == other.count && columnGap == other.columnGap
     62    return width == other.width && count == other.count
    6463        && rule == other.rule && visitedLinkColumnRuleColor == other.visitedLinkColumnRuleColor
    6564        && autoWidth == other.autoWidth && autoCount == other.autoCount
  • trunk/Source/WebCore/rendering/style/StyleMultiColData.h

    r227676 r228095  
    5151    float width { 0 };
    5252    unsigned short count;
    53     GapLength columnGap;
    5453    BorderValue rule;
    5554    Color visitedLinkColumnRuleColor;
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp

    r227577 r228095  
    107107    , hasAttrContent(false)
    108108    , isNotFinal(false)
     109    , columnGap(RenderStyle::initialColumnGap())
     110    , rowGap(RenderStyle::initialRowGap())
    109111{
    110112    maskBoxImage.setMaskDefaults();
     
    198200    , hasAttrContent(o.hasAttrContent)
    199201    , isNotFinal(o.isNotFinal)
     202    , columnGap(o.columnGap)
     203    , rowGap(o.rowGap)
    200204{
    201205}
     
    297301        && resize == o.resize
    298302        && hasAttrContent == o.hasAttrContent
    299         && isNotFinal == o.isNotFinal;
     303        && isNotFinal == o.isNotFinal
     304        && columnGap == o.columnGap
     305        && rowGap == o.rowGap;
    300306}
    301307
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h

    r227577 r228095  
    214214    unsigned isNotFinal : 1;
    215215
     216    GapLength columnGap;
     217    GapLength rowGap;
     218
    216219private:
    217220    StyleRareNonInheritedData();
Note: See TracChangeset for help on using the changeset viewer.