OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/css/parser/CSSPropertyParser.h" | 5 #include "core/css/parser/CSSPropertyParser.h" |
6 | 6 |
7 #include "core/StylePropertyShorthand.h" | 7 #include "core/StylePropertyShorthand.h" |
8 #include "core/css/CSSBasicShapeValues.h" | 8 #include "core/css/CSSBasicShapeValues.h" |
9 #include "core/css/CSSBorderImage.h" | 9 #include "core/css/CSSBorderImage.h" |
10 #include "core/css/CSSContentDistributionValue.h" | 10 #include "core/css/CSSContentDistributionValue.h" |
(...skipping 3241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3252 if (spanValue) | 3252 if (spanValue) |
3253 values->append(spanValue); | 3253 values->append(spanValue); |
3254 if (numericValue) | 3254 if (numericValue) |
3255 values->append(numericValue); | 3255 values->append(numericValue); |
3256 if (gridLineName) | 3256 if (gridLineName) |
3257 values->append(gridLineName); | 3257 values->append(gridLineName); |
3258 ASSERT(values->length()); | 3258 ASSERT(values->length()); |
3259 return values; | 3259 return values; |
3260 } | 3260 } |
3261 | 3261 |
3262 static bool isGridTrackFixedSized(const CSSValue& value) | 3262 static bool isGridTrackFixedSized(const CSSPrimitiveValue& primitiveValue) |
3263 { | 3263 { |
3264 const CSSPrimitiveValue& primitiveValue = value.isPrimitiveValue() | |
3265 ? toCSSPrimitiveValue(value) | |
3266 : toCSSPrimitiveValue(*toCSSFunctionValue(value).item(0)); | |
3267 CSSValueID valueID = primitiveValue.getValueID(); | 3264 CSSValueID valueID = primitiveValue.getValueID(); |
3268 if (valueID == CSSValueMinContent || valueID == CSSValueMaxContent || valueI
D == CSSValueAuto || primitiveValue.isFlex()) | 3265 if (valueID == CSSValueMinContent || valueID == CSSValueMaxContent || valueI
D == CSSValueAuto || primitiveValue.isFlex()) |
3269 return false; | 3266 return false; |
3270 | 3267 |
3271 return true; | 3268 return true; |
3272 } | 3269 } |
3273 | 3270 |
| 3271 static bool isGridTrackFixedSized(const CSSValue& value) |
| 3272 { |
| 3273 if (value.isPrimitiveValue()) |
| 3274 return isGridTrackFixedSized(toCSSPrimitiveValue(value)); |
| 3275 |
| 3276 const CSSPrimitiveValue& minPrimitiveValue = toCSSPrimitiveValue(*toCSSFunct
ionValue(value).item(0)); |
| 3277 const CSSPrimitiveValue& maxPrimitiveValue = toCSSPrimitiveValue(*toCSSFunct
ionValue(value).item(1)); |
| 3278 return isGridTrackFixedSized(minPrimitiveValue) || isGridTrackFixedSized(max
PrimitiveValue); |
| 3279 } |
| 3280 |
3274 static Vector<String> parseGridTemplateAreasColumnNames(const String& gridRowNam
es) | 3281 static Vector<String> parseGridTemplateAreasColumnNames(const String& gridRowNam
es) |
3275 { | 3282 { |
3276 ASSERT(!gridRowNames.isEmpty()); | 3283 ASSERT(!gridRowNames.isEmpty()); |
3277 Vector<String> columnNames; | 3284 Vector<String> columnNames; |
3278 // Using StringImpl to avoid checks and indirection in every call to String:
:operator[]. | 3285 // Using StringImpl to avoid checks and indirection in every call to String:
:operator[]. |
3279 StringImpl& text = *gridRowNames.impl(); | 3286 StringImpl& text = *gridRowNames.impl(); |
3280 | 3287 |
3281 StringBuilder areaName; | 3288 StringBuilder areaName; |
3282 for (unsigned i = 0; i < text.length(); ++i) { | 3289 for (unsigned i = 0; i < text.length(); ++i) { |
3283 if (isCSSSpace(text[i])) { | 3290 if (isCSSSpace(text[i])) { |
(...skipping 1878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5162 case CSSPropertyGridTemplate: | 5169 case CSSPropertyGridTemplate: |
5163 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important); | 5170 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important); |
5164 case CSSPropertyGrid: | 5171 case CSSPropertyGrid: |
5165 return consumeGridShorthand(important); | 5172 return consumeGridShorthand(important); |
5166 default: | 5173 default: |
5167 return false; | 5174 return false; |
5168 } | 5175 } |
5169 } | 5176 } |
5170 | 5177 |
5171 } // namespace blink | 5178 } // namespace blink |
OLD | NEW |