Ignore:
Timestamp:
Mar 24, 2014, 2:42:21 AM (11 years ago)
Author:
[email protected]
Message:

[CSS Grid Layout] Update named <grid-line> syntax to the last version of the specs
https://bugs.webkit.org/show_bug.cgi?id=129041

Patch by Javier Fernandez <[email protected]> on 2014-03-24
Reviewed by Sergio Villar Senin.

From Blink r162555 by <[email protected]>

Source/WebCore:

Names for grid lines are now specified as a list of whitespace separated
idents enclosed in parentheses instead of as a list of strings.

Updated tests to match the new <grid-line> syntax.

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • WebCore.xcodeproj/project.pbxproj: Added info of the new file for the CSSGridLineNamesValue class.
  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::addValuesForNamedGridLinesAtIndex): The named <grid-line> value is now a list.

  • css/CSSGrammar.y.in: New syntax for named <grid-line>.
  • css/CSSGridLineNamesValue.cpp: Added.

(WebCore::CSSGridLineNamesValue::customCSSText): String representation of the named <grid-line> as a list of Strings.
(WebCore::CSSGridLineNamesValue::CSSGridLineNamesValue): Constructor.
(WebCore::CSSGridLineNamesValue::cloneForCSSOM): Ref counted cloning function.

  • css/CSSGridLineNamesValue.h: Added.

(WebCore::CSSGridLineNamesValue::create): Ref counted constructor.

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseGridLineNames): It replaces the old parseGrdTrackNames.
(WebCore::CSSParser::parseGridTrackList): Using the new named <grid-line> syntax.
(WebCore::CSSParser::parseGridTrackRepeatFunction): Using the new named <grid-line> syntax.

  • css/CSSParser.h:
  • css/CSSParserValues.cpp:

(WebCore::destroy): Handling the case of CSSValue being CSSValueList intances.
(WebCore::CSSParserValue::createCSSValue): Handling the case of CSSValue being CSSValueList intances.

  • css/CSSParserValues.h:

(WebCore::CSSParserValue::setFromValueList): Adds the named <grid-line> list to the CSSParserValueList instance.

  • css/CSSValue.cpp:

(WebCore::CSSValue::equals): Handling the case of the new CSSGridLineNamesValue class.
(WebCore::CSSValue::cssText): Handling the case of the new CSSGridLineNamesValue class.
(WebCore::CSSValue::destroy): Handling the case of the new CSSGridLineNamesValue class.

  • css/CSSValue.h:

(WebCore::CSSValue::isGridLineNamesValue): Type cast check for the new CSSGridLineNamesValue class.

  • css/StyleResolver.cpp:

(WebCore::createGridTrackList): Using the new named <grid-line> syntax.

LayoutTests:

Updated tests to match the new <grid-line> syntax.

  • fast/css-grid-layout/grid-columns-rows-get-set-expected.txt:
  • fast/css-grid-layout/grid-columns-rows-get-set-multiple-expected.txt:
  • fast/css-grid-layout/grid-element-repeat-get-set-expected.txt:
  • fast/css-grid-layout/grid-element-repeat-get-set.html:
  • fast/css-grid-layout/grid-item-bad-resolution-double-span.html:
  • fast/css-grid-layout/grid-item-named-grid-area-resolution.html:
  • fast/css-grid-layout/grid-item-named-grid-line-resolution.html:
  • fast/css-grid-layout/grid-item-negative-position-resolution.html:
  • fast/css-grid-layout/grid-item-position-changed-dynamic.html:
  • fast/css-grid-layout/named-grid-line-get-set-expected.txt:
  • fast/css-grid-layout/named-grid-line-get-set.html:
  • fast/css-grid-layout/named-grid-lines-with-named-grid-areas-resolution.html:
  • fast/css-grid-layout/non-grid-columns-rows-get-set-expected.txt:
  • fast/css-grid-layout/non-grid-columns-rows-get-set-multiple-expected.txt:
  • fast/css-grid-layout/non-grid-element-repeat-get-set-expected.txt:
  • fast/css-grid-layout/non-grid-element-repeat-get-set.html:
  • fast/css-grid-layout/non-named-grid-line-get-set-expected.txt:
  • fast/css-grid-layout/non-named-grid-line-get-set.html:
  • fast/css-grid-layout/resources/grid-columns-rows-get-set-multiple.js:

(testInherit):
(testInitial):

  • fast/css-grid-layout/resources/grid-columns-rows-get-set.js:

(testInherit):
(testInitial):

  • fast/css-grid-layout/resources/non-grid-columns-rows-get-set-multiple.js:

(testInherit):
(testInitial):

  • fast/css-grid-layout/resources/non-grid-columns-rows-get-set.js:

(testInherit):
(testInitial):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/css/CSSValue.cpp

    r165676 r166157  
    5858
    5959#if ENABLE(CSS_GRID_LAYOUT)
     60#include "CSSGridLineNamesValue.h"
    6061#include "CSSGridTemplateAreasValue.h"
    6162#endif
     
    194195            return compareCSSValues<CSSInitialValue>(*this, other);
    195196#if ENABLE(CSS_GRID_LAYOUT)
     197        case GridLineNamesClass:
     198            return compareCSSValues<CSSGridLineNamesValue>(*this, other);
    196199        case GridTemplateAreasClass:
    197200            return compareCSSValues<CSSGridTemplateAreasValue>(*this, other);
     
    282285        return toCSSInitialValue(this)->customCSSText();
    283286#if ENABLE(CSS_GRID_LAYOUT)
     287    case GridLineNamesClass:
     288        return toCSSGridLineNamesValue(this)->customCSSText();
    284289    case GridTemplateAreasClass:
    285290        return toCSSGridTemplateAreasValue(this)->customCSSText();
     
    375380        return;
    376381#if ENABLE(CSS_GRID_LAYOUT)
     382    case GridLineNamesClass:
     383        delete toCSSGridLineNamesValue(this);
     384        return;
    377385    case GridTemplateAreasClass:
    378386        delete toCSSGridTemplateAreasValue(this);
Note: See TracChangeset for help on using the changeset viewer.