Changeset 195529 in webkit


Ignore:
Timestamp:
Jan 25, 2016 1:24:19 AM (8 years ago)
Author:
svillar@igalia.com
Message:

[css-grid] grid shorthand must reset gap properties to their initial values
https://bugs.webkit.org/show_bug.cgi?id=153354

Reviewed by Darin Adler.

Source/WebCore:

Both 'grid-row-gap' & 'grid-column-gap' are considered reset-only subproperties of the
'grid' shorthand meaning that, even thought the shorthand does not offer a way to set
their values, it must in any case reset them to the initial ones.

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseGridShorthand):

  • css/CSSPropertyNames.in:

LayoutTests:

  • fast/css-grid-layout/grid-shorthand-get-set-expected.txt:
  • fast/css-grid-layout/grid-shorthand-get-set.html:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r195527 r195529  
     12016-01-22  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [css-grid] grid shorthand must reset gap properties to their initial values
     4        https://bugs.webkit.org/show_bug.cgi?id=153354
     5
     6        Reviewed by Darin Adler.
     7
     8        * fast/css-grid-layout/grid-shorthand-get-set-expected.txt:
     9        * fast/css-grid-layout/grid-shorthand-get-set.html:
     10
    1112016-01-24  Brady Eidson  <beidson@apple.com>
    212
  • trunk/LayoutTests/fast/css-grid-layout/grid-shorthand-get-set-expected.txt

    r185147 r195529  
    259259PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-auto-rows') is "auto"
    260260PASS element.style.webkitGridAutoRows is "initial"
     261
     262Test the inherit value on reset-only subproperties (grid-*-gap)
     263PASS getComputedStyle(anotherElement, '').getPropertyValue('-webkit-grid-column-gap') is "0px"
     264PASS getComputedStyle(anotherElement, '').getPropertyValue('-webkit-grid-row-gap') is "0px"
     265PASS getComputedStyle(anotherElement, '').getPropertyValue('-webkit-grid-column-gap') is "20px"
     266PASS getComputedStyle(anotherElement, '').getPropertyValue('-webkit-grid-row-gap') is "100px"
    261267PASS successfullyParsed is true
    262268
  • trunk/LayoutTests/fast/css-grid-layout/grid-shorthand-get-set.html

    r185147 r195529  
    1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
     1<!DOCTYPE html>
    22<html>
    33<head>
     
    179179    testGridDefinitionsSetJSValues("none", "none", "none", "none", "row", "auto", "auto", "none", "none", "none", "initial", "initial", "initial");
    180180
     181    debug("");
     182    debug("Test the inherit value on reset-only subproperties (grid-*-gap)");
     183    document.body.style.webkitGridRowGap = "100px";
     184    document.body.style.webkitGridColumnGap = "20px";
     185    var anotherElement = document.createElement("div");
     186    document.body.appendChild(anotherElement);
     187    shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue('-webkit-grid-column-gap')", "0px");
     188    shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue('-webkit-grid-row-gap')", "0px");
     189    anotherElement.style.webkitGrid = "inherit";
     190    shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue('-webkit-grid-column-gap')", "20px");
     191    shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue('-webkit-grid-row-gap')", "100px");
    181192</script>
    182193</body>
  • trunk/Source/WebCore/ChangeLog

    r195527 r195529  
     12016-01-22  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [css-grid] grid shorthand must reset gap properties to their initial values
     4        https://bugs.webkit.org/show_bug.cgi?id=153354
     5
     6        Reviewed by Darin Adler.
     7
     8        Both 'grid-row-gap' & 'grid-column-gap' are considered reset-only subproperties of the
     9        'grid' shorthand meaning that, even thought the shorthand does not offer a way to set
     10        their values, it must in any case reset them to the initial ones.
     11
     12        * css/CSSParser.cpp:
     13        (WebCore::CSSParser::parseGridShorthand):
     14        * css/CSSPropertyNames.in:
     15
    1162016-01-24  Brady Eidson  <beidson@apple.com>
    217
  • trunk/Source/WebCore/css/CSSParser.cpp

    r195452 r195529  
    56515651{
    56525652    ShorthandScope scope(this, CSSPropertyWebkitGrid);
    5653     ASSERT(shorthandForProperty(CSSPropertyWebkitGrid).length() == 6);
     5653    ASSERT(shorthandForProperty(CSSPropertyWebkitGrid).length() == 8);
    56545654
    56555655    // 1- <grid-template>
     
    56605660        addProperty(CSSPropertyWebkitGridAutoColumns, CSSValuePool::singleton().createImplicitInitialValue(), important);
    56615661        addProperty(CSSPropertyWebkitGridAutoRows, CSSValuePool::singleton().createImplicitInitialValue(), important);
     5662        addProperty(CSSPropertyWebkitGridColumnGap, CSSValuePool::singleton().createImplicitInitialValue(), important);
     5663        addProperty(CSSPropertyWebkitGridRowGap, CSSValuePool::singleton().createImplicitInitialValue(), important);
    56625664        return true;
    56635665    }
     
    57045706    addProperty(CSSPropertyWebkitGridTemplateRows, CSSValuePool::singleton().createImplicitInitialValue(), important);
    57055707    addProperty(CSSPropertyWebkitGridTemplateAreas, CSSValuePool::singleton().createImplicitInitialValue(), important);
     5708    addProperty(CSSPropertyWebkitGridColumnGap, CSSValuePool::singleton().createImplicitInitialValue(), important);
     5709    addProperty(CSSPropertyWebkitGridRowGap, CSSValuePool::singleton().createImplicitInitialValue(), important);
    57065710
    57075711    return true;
  • trunk/Source/WebCore/css/CSSPropertyNames.in

    r194421 r195529  
    492492-webkit-justify-items = justify-items
    493493#if defined(ENABLE_CSS_GRID_LAYOUT) && ENABLE_CSS_GRID_LAYOUT
    494 -webkit-grid [Longhands=-webkit-grid-template-columns|-webkit-grid-template-rows|-webkit-grid-template-areas|-webkit-grid-auto-flow|-webkit-grid-auto-columns|-webkit-grid-auto-rows]
     494-webkit-grid [Longhands=-webkit-grid-template-columns|-webkit-grid-template-rows|-webkit-grid-template-areas|-webkit-grid-auto-flow|-webkit-grid-auto-columns|-webkit-grid-auto-rows|-webkit-grid-column-gap|-webkit-grid-row-gap]
    495495-webkit-grid-area [Longhands=-webkit-grid-row-start|-webkit-grid-column-start|-webkit-grid-row-end|-webkit-grid-column-end]
    496496-webkit-grid-auto-columns [Converter=GridTrackSize]
Note: See TracChangeset for help on using the changeset viewer.