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 "config.h" | 5 #include "config.h" |
6 #include "core/css/parser/CSSPropertyParser.h" | 6 #include "core/css/parser/CSSPropertyParser.h" |
7 | 7 |
8 #include "core/StylePropertyShorthand.h" | 8 #include "core/StylePropertyShorthand.h" |
9 #include "core/css/CSSCalculationValue.h" | 9 #include "core/css/CSSCalculationValue.h" |
10 #include "core/css/CSSCustomIdentValue.h" | 10 #include "core/css/CSSCustomIdentValue.h" |
(...skipping 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1195 if (!value) | 1195 if (!value) |
1196 return nullptr; | 1196 return nullptr; |
1197 list->append(value.release()); | 1197 list->append(value.release()); |
1198 } while (consumeCommaIncludingWhitespace(range)); | 1198 } while (consumeCommaIncludingWhitespace(range)); |
1199 if (!isValidAnimationPropertyList(property, *list)) | 1199 if (!isValidAnimationPropertyList(property, *list)) |
1200 return nullptr; | 1200 return nullptr; |
1201 ASSERT(list->length()); | 1201 ASSERT(list->length()); |
1202 return list.release(); | 1202 return list.release(); |
1203 } | 1203 } |
1204 | 1204 |
1205 static PassRefPtrWillBeRawPtr<CSSValue> consumeWidowsOrOrphans(CSSParserTokenRan ge& range) | |
1206 { | |
1207 if (range.peek().id() == CSSValueAuto) | |
Timothy Loh
2015/10/21 04:01:53
Probably should comment that auto is non-standard
| |
1208 return consumeIdent(range); | |
1209 return consumePositiveInteger(range); | |
1210 } | |
1211 | |
1205 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSProperty ID unresolvedProperty) | 1212 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSProperty ID unresolvedProperty) |
1206 { | 1213 { |
1207 CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty); | 1214 CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty); |
1208 m_range.consumeWhitespace(); | 1215 m_range.consumeWhitespace(); |
1209 switch (property) { | 1216 switch (property) { |
1210 case CSSPropertyWillChange: | 1217 case CSSPropertyWillChange: |
1211 return consumeWillChange(m_range); | 1218 return consumeWillChange(m_range); |
1212 case CSSPropertyPage: | 1219 case CSSPropertyPage: |
1213 return consumePage(m_range); | 1220 return consumePage(m_range); |
1214 case CSSPropertyQuotes: | 1221 case CSSPropertyQuotes: |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1289 case CSSPropertyAnimationDuration: | 1296 case CSSPropertyAnimationDuration: |
1290 case CSSPropertyTransitionDuration: | 1297 case CSSPropertyTransitionDuration: |
1291 case CSSPropertyAnimationFillMode: | 1298 case CSSPropertyAnimationFillMode: |
1292 case CSSPropertyAnimationIterationCount: | 1299 case CSSPropertyAnimationIterationCount: |
1293 case CSSPropertyAnimationName: | 1300 case CSSPropertyAnimationName: |
1294 case CSSPropertyAnimationPlayState: | 1301 case CSSPropertyAnimationPlayState: |
1295 case CSSPropertyTransitionProperty: | 1302 case CSSPropertyTransitionProperty: |
1296 case CSSPropertyAnimationTimingFunction: | 1303 case CSSPropertyAnimationTimingFunction: |
1297 case CSSPropertyTransitionTimingFunction: | 1304 case CSSPropertyTransitionTimingFunction: |
1298 return consumeAnimationPropertyList(property, m_range, m_context, unreso lvedProperty == CSSPropertyAliasWebkitAnimationName); | 1305 return consumeAnimationPropertyList(property, m_range, m_context, unreso lvedProperty == CSSPropertyAliasWebkitAnimationName); |
1306 case CSSPropertyOrphans: | |
1307 case CSSPropertyWidows: | |
1308 return consumeWidowsOrOrphans(m_range); | |
1299 default: | 1309 default: |
1300 return nullptr; | 1310 return nullptr; |
1301 } | 1311 } |
1302 } | 1312 } |
1303 | 1313 |
1304 static PassRefPtrWillBeRawPtr<CSSValueList> consumeFontFaceUnicodeRange(CSSParse rTokenRange& range) | 1314 static PassRefPtrWillBeRawPtr<CSSValueList> consumeFontFaceUnicodeRange(CSSParse rTokenRange& range) |
1305 { | 1315 { |
1306 RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createCommaSeparated (); | 1316 RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createCommaSeparated (); |
1307 | 1317 |
1308 do { | 1318 do { |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1719 m_currentShorthand = oldShorthand; | 1729 m_currentShorthand = oldShorthand; |
1720 return consumeColumns(important); | 1730 return consumeColumns(important); |
1721 } | 1731 } |
1722 default: | 1732 default: |
1723 m_currentShorthand = oldShorthand; | 1733 m_currentShorthand = oldShorthand; |
1724 return false; | 1734 return false; |
1725 } | 1735 } |
1726 } | 1736 } |
1727 | 1737 |
1728 } // namespace blink | 1738 } // namespace blink |
OLD | NEW |