Ignore:
Timestamp:
Aug 6, 2013, 4:45:58 AM (12 years ago)
Author:
sergio@webkit.org
Message:

[CSS Grid Layout] Add support for parsing <grid-line> that includes a 'span'
https://bugs.webkit.org/show_bug.cgi?id=118051

Reviewed by Andreas Kling.

From Blink r148766 by <jchaffraix@chromium.org>

Source/WebCore:

This adds the parsing, style resolution and getComputedStyle bits
to our code. The rendering code was not made aware of the new type
of GridPosition yet.

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::valueForGridPosition):

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseGridPosition):

  • css/CSSParser.h:
  • css/CSSValueKeywords.in:
  • css/StyleResolver.cpp:

(WebCore::StyleResolver::adjustRenderStyle):
(WebCore::StyleResolver::adjustGridItemPosition):
(WebCore::createGridPosition):

  • css/StyleResolver.h:
  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::resolveGridPositionFromStyle):

  • rendering/style/GridPosition.h:

(WebCore::GridPosition::isInteger):
(WebCore::GridPosition::isSpan):
(WebCore::GridPosition::setSpanPosition):
(WebCore::GridPosition::spanPosition):

LayoutTests:

Added several test cases to check that we properly parse the
keyword 'span' in <grid-line>.

  • fast/css-grid-layout/grid-item-column-row-get-set-expected.txt:
  • fast/css-grid-layout/grid-item-column-row-get-set.html:
  • fast/css-grid-layout/grid-item-end-after-get-set-expected.txt:
  • fast/css-grid-layout/grid-item-end-after-get-set.html:
  • fast/css-grid-layout/grid-item-start-before-get-set-expected.txt:
  • fast/css-grid-layout/grid-item-start-before-get-set.html:
File:
1 edited

Legend:

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

    r153746 r153748  
    11011101        return cssValuePool().createIdentifierValue(CSSValueAuto);
    11021102
    1103     return cssValuePool().createValue(position.integerPosition(), CSSPrimitiveValue::CSS_NUMBER);
    1104 }
     1103    if (position.isInteger())
     1104        return cssValuePool().createValue(position.integerPosition(), CSSPrimitiveValue::CSS_NUMBER);
     1105
     1106    RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
     1107    list->append(cssValuePool().createIdentifierValue(CSSValueSpan));
     1108    list->append(cssValuePool().createValue(position.spanPosition(), CSSPrimitiveValue::CSS_NUMBER));
     1109    return list.release();
     1110}
     1111
    11051112static PassRefPtr<CSSValue> createTransitionPropertyValue(const Animation* animation)
    11061113{
Note: See TracChangeset for help on using the changeset viewer.