Index: Source/core/css/StyleResolver.cpp |
diff --git a/Source/core/css/StyleResolver.cpp b/Source/core/css/StyleResolver.cpp |
index 7a02f2f3b8f3ade7958df85243fb563f32c06318..844bfe05bfeb9864c9123d78c6a2263e4760a54a 100644 |
--- a/Source/core/css/StyleResolver.cpp |
+++ b/Source/core/css/StyleResolver.cpp |
@@ -2306,7 +2306,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, NamedGridLinesMapping& namedGridLines, const StyleResolver::State& state) |
{ |
// Handle 'none'. |
if (value->isPrimitiveValue()) { |
@@ -2317,8 +2317,19 @@ 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()) { |
+ NamedGridLinesMapping::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; |
@@ -2992,16 +3003,20 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value) |
} |
case CSSPropertyWebkitGridColumns: { |
Vector<GridTrackSize> trackSizes; |
- if (!createGridTrackList(value, trackSizes, state)) |
+ NamedGridLinesMapping 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)) |
+ NamedGridLinesMapping namedGridLines; |
+ if (!createGridTrackList(value, trackSizes, namedGridLines, state)) |
return; |
state.style()->setGridRows(trackSizes); |
+ state.style()->setNamedGridRowLines(namedGridLines); |
return; |
} |