| 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 // Support for auto is non-standard and for backwards compatibility. |
| 1208 if (range.peek().id() == CSSValueAuto) |
| 1209 return consumeIdent(range); |
| 1210 return consumePositiveInteger(range); |
| 1211 } |
| 1212 |
| 1205 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSProperty
ID unresolvedProperty) | 1213 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSProperty
ID unresolvedProperty) |
| 1206 { | 1214 { |
| 1207 CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty); | 1215 CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty); |
| 1208 m_range.consumeWhitespace(); | 1216 m_range.consumeWhitespace(); |
| 1209 switch (property) { | 1217 switch (property) { |
| 1210 case CSSPropertyWillChange: | 1218 case CSSPropertyWillChange: |
| 1211 return consumeWillChange(m_range); | 1219 return consumeWillChange(m_range); |
| 1212 case CSSPropertyPage: | 1220 case CSSPropertyPage: |
| 1213 return consumePage(m_range); | 1221 return consumePage(m_range); |
| 1214 case CSSPropertyQuotes: | 1222 case CSSPropertyQuotes: |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1289 case CSSPropertyAnimationDuration: | 1297 case CSSPropertyAnimationDuration: |
| 1290 case CSSPropertyTransitionDuration: | 1298 case CSSPropertyTransitionDuration: |
| 1291 case CSSPropertyAnimationFillMode: | 1299 case CSSPropertyAnimationFillMode: |
| 1292 case CSSPropertyAnimationIterationCount: | 1300 case CSSPropertyAnimationIterationCount: |
| 1293 case CSSPropertyAnimationName: | 1301 case CSSPropertyAnimationName: |
| 1294 case CSSPropertyAnimationPlayState: | 1302 case CSSPropertyAnimationPlayState: |
| 1295 case CSSPropertyTransitionProperty: | 1303 case CSSPropertyTransitionProperty: |
| 1296 case CSSPropertyAnimationTimingFunction: | 1304 case CSSPropertyAnimationTimingFunction: |
| 1297 case CSSPropertyTransitionTimingFunction: | 1305 case CSSPropertyTransitionTimingFunction: |
| 1298 return consumeAnimationPropertyList(property, m_range, m_context, unreso
lvedProperty == CSSPropertyAliasWebkitAnimationName); | 1306 return consumeAnimationPropertyList(property, m_range, m_context, unreso
lvedProperty == CSSPropertyAliasWebkitAnimationName); |
| 1307 case CSSPropertyOrphans: |
| 1308 case CSSPropertyWidows: |
| 1309 return consumeWidowsOrOrphans(m_range); |
| 1299 default: | 1310 default: |
| 1300 return nullptr; | 1311 return nullptr; |
| 1301 } | 1312 } |
| 1302 } | 1313 } |
| 1303 | 1314 |
| 1304 static PassRefPtrWillBeRawPtr<CSSValueList> consumeFontFaceUnicodeRange(CSSParse
rTokenRange& range) | 1315 static PassRefPtrWillBeRawPtr<CSSValueList> consumeFontFaceUnicodeRange(CSSParse
rTokenRange& range) |
| 1305 { | 1316 { |
| 1306 RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createCommaSeparated
(); | 1317 RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createCommaSeparated
(); |
| 1307 | 1318 |
| 1308 do { | 1319 do { |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1719 m_currentShorthand = oldShorthand; | 1730 m_currentShorthand = oldShorthand; |
| 1720 return consumeColumns(important); | 1731 return consumeColumns(important); |
| 1721 } | 1732 } |
| 1722 default: | 1733 default: |
| 1723 m_currentShorthand = oldShorthand; | 1734 m_currentShorthand = oldShorthand; |
| 1724 return false; | 1735 return false; |
| 1725 } | 1736 } |
| 1726 } | 1737 } |
| 1727 | 1738 |
| 1728 } // namespace blink | 1739 } // namespace blink |
| OLD | NEW |