| Index: Source/core/css/StyleResolver.cpp
|
| diff --git a/Source/core/css/StyleResolver.cpp b/Source/core/css/StyleResolver.cpp
|
| index 672c653bc3e3c50e30c85af0f925e3005fdd0a95..4eb6f150cb740a10ee062e01b16cc8583b0881d9 100644
|
| --- a/Source/core/css/StyleResolver.cpp
|
| +++ b/Source/core/css/StyleResolver.cpp
|
| @@ -2295,7 +2295,7 @@ static bool createGridTrackSize(CSSValue* value, GridTrackSize& trackSize, const
|
| return true;
|
| }
|
|
|
| -static bool createGridTrackList(CSSValue* value, Vector<GridTrackSize>& trackSizes, const StyleResolver::State& state)
|
| +static bool createGridTrackList(CSSValue* value, Vector<GridTrackSize>& trackSizes, NamedGridLinesMap& namedGridLines, const StyleResolver::State& state)
|
| {
|
| // Handle 'none'.
|
| if (value->isPrimitiveValue()) {
|
| @@ -2306,14 +2306,29 @@ static bool createGridTrackList(CSSValue* value, Vector<GridTrackSize>& trackSiz
|
| if (!value->isValueList())
|
| return false;
|
|
|
| + size_t currentNamedGridLine = 0;
|
| for (CSSValueListIterator i = value; i.hasMore(); i.advance()) {
|
| CSSValue* currValue = i.value();
|
| + if (currValue->isPrimitiveValue()) {
|
| + CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(currValue);
|
| + if (primitiveValue->isString()) {
|
| + NamedGridLinesMap::AddResult result = namedGridLines.add(primitiveValue->getStringValue(), Vector<size_t>());
|
| + result.iterator->value.append(currentNamedGridLine);
|
| + continue;
|
| + }
|
| + }
|
| +
|
| + ++currentNamedGridLine;
|
| GridTrackSize trackSize;
|
| if (!createGridTrackSize(currValue, trackSize, state))
|
| return false;
|
|
|
| trackSizes.append(trackSize);
|
| }
|
| +
|
| + if (trackSizes.isEmpty())
|
| + return false;
|
| +
|
| return true;
|
| }
|
|
|
| @@ -2977,16 +2992,20 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
|
| }
|
| case CSSPropertyWebkitGridColumns: {
|
| Vector<GridTrackSize> trackSizes;
|
| - if (!createGridTrackList(value, trackSizes, state))
|
| + NamedGridLinesMap namedGridLines;
|
| + if (!createGridTrackList(value, trackSizes, namedGridLines, state))
|
| return;
|
| state.style()->setGridColumns(trackSizes);
|
| + state.style()->setNamedGridColumnLines(namedGridLines);
|
| return;
|
| }
|
| case CSSPropertyWebkitGridRows: {
|
| Vector<GridTrackSize> trackSizes;
|
| - if (!createGridTrackList(value, trackSizes, state))
|
| + NamedGridLinesMap namedGridLines;
|
| + if (!createGridTrackList(value, trackSizes, namedGridLines, state))
|
| return;
|
| state.style()->setGridRows(trackSizes);
|
| + state.style()->setNamedGridRowLines(namedGridLines);
|
| return;
|
| }
|
|
|
|
|