Changeset 153752 in webkit for trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
- Timestamp:
- Aug 6, 2013, 8:08:21 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r153748 r153752 1084 1084 } 1085 1085 1086 static PassRefPtr<CSSValue> valueForGridTrackList(const Vector<GridTrackSize>& trackSizes, const RenderStyle* style, RenderView *renderView) 1086 static void addValuesForNamedGridLinesAtIndex(const NamedGridLinesMap& namedGridLines, size_t i, CSSValueList& list) 1087 { 1088 // Note that this won't return the results in the order specified in the style sheet, 1089 // which is probably fine as we still *do* return all the expected values. 1090 NamedGridLinesMap::const_iterator it = namedGridLines.begin(); 1091 NamedGridLinesMap::const_iterator end = namedGridLines.end(); 1092 for (; it != end; ++it) { 1093 const Vector<size_t>& linesIndexes = it->value; 1094 for (size_t j = 0; j < linesIndexes.size(); ++j) { 1095 if (linesIndexes[j] != i) 1096 continue; 1097 1098 list.append(cssValuePool().createValue(it->key, CSSPrimitiveValue::CSS_STRING)); 1099 break; 1100 } 1101 } 1102 } 1103 1104 static PassRefPtr<CSSValue> valueForGridTrackList(const Vector<GridTrackSize>& trackSizes, const NamedGridLinesMap& namedGridLines, const RenderStyle* style, RenderView* renderView) 1087 1105 { 1088 1106 // Handle the 'none' case here. 1089 if (!trackSizes.size()) 1107 if (!trackSizes.size()) { 1108 ASSERT(namedGridLines.isEmpty()); 1090 1109 return cssValuePool().createIdentifierValue(CSSValueNone); 1110 } 1091 1111 1092 1112 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); 1093 for (size_t i = 0; i < trackSizes.size(); ++i) 1113 for (size_t i = 0; i < trackSizes.size(); ++i) { 1114 addValuesForNamedGridLinesAtIndex(namedGridLines, i, *list); 1094 1115 list->append(valueForGridTrackSize(trackSizes[i], style, renderView)); 1116 } 1117 // Those are the trailing <string>* allowed in the syntax. 1118 addValuesForNamedGridLinesAtIndex(namedGridLines, trackSizes.size(), *list); 1095 1119 return list.release(); 1096 1120 } … … 2045 2069 return valueForGridTrackSize(style->gridAutoRows(), style.get(), m_node->document()->renderView()); 2046 2070 case CSSPropertyWebkitGridDefinitionColumns: 2047 return valueForGridTrackList(style->gridColumns(), style .get(), m_node->document()->renderView());2071 return valueForGridTrackList(style->gridColumns(), style->namedGridColumnLines(), style.get(), m_node->document()->renderView()); 2048 2072 case CSSPropertyWebkitGridDefinitionRows: 2049 return valueForGridTrackList(style->gridRows(), style .get(), m_node->document()->renderView());2073 return valueForGridTrackList(style->gridRows(), style->namedGridRowLines(), style.get(), m_node->document()->renderView()); 2050 2074 2051 2075 case CSSPropertyWebkitGridColumnStart:
Note:
See TracChangeset
for help on using the changeset viewer.