| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/CSSParserFastPaths.h" | 5 #include "core/css/parser/CSSParserFastPaths.h" |
| 6 | 6 |
| 7 #include "core/StylePropertyShorthand.h" | 7 #include "core/StylePropertyShorthand.h" |
| 8 #include "core/css/CSSColorValue.h" | 8 #include "core/css/CSSColorValue.h" |
| 9 #include "core/css/CSSFunctionValue.h" | 9 #include "core/css/CSSFunctionValue.h" |
| 10 #include "core/css/CSSInheritedValue.h" | 10 #include "core/css/CSSInheritedValue.h" |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 return true; | 436 return true; |
| 437 } | 437 } |
| 438 | 438 |
| 439 return false; | 439 return false; |
| 440 } | 440 } |
| 441 | 441 |
| 442 CSSValue* CSSParserFastPaths::parseColor(const String& string, CSSParserMode par
serMode) | 442 CSSValue* CSSParserFastPaths::parseColor(const String& string, CSSParserMode par
serMode) |
| 443 { | 443 { |
| 444 ASSERT(!string.isEmpty()); | 444 ASSERT(!string.isEmpty()); |
| 445 CSSValueID valueID = cssValueKeywordID(string); | 445 CSSValueID valueID = cssValueKeywordID(string); |
| 446 if (CSSPropertyParser::isColorKeyword(valueID)) { | 446 if (isColorKeyword(valueID)) { |
| 447 if (!isValueAllowedInMode(valueID, parserMode)) | 447 if (!isValueAllowedInMode(valueID, parserMode)) |
| 448 return nullptr; | 448 return nullptr; |
| 449 return CSSPrimitiveValue::createIdentifier(valueID); | 449 return CSSPrimitiveValue::createIdentifier(valueID); |
| 450 } | 450 } |
| 451 | 451 |
| 452 RGBA32 color; | 452 RGBA32 color; |
| 453 bool quirksMode = isQuirksModeBehavior(parserMode); | 453 bool quirksMode = isQuirksModeBehavior(parserMode); |
| 454 | 454 |
| 455 // Fast path for hex colors and rgb()/rgba() colors | 455 // Fast path for hex colors and rgb()/rgba() colors |
| 456 bool parseResult; | 456 bool parseResult; |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1073 if (isColorPropertyID(propertyID)) | 1073 if (isColorPropertyID(propertyID)) |
| 1074 return parseColor(string, parserMode); | 1074 return parseColor(string, parserMode); |
| 1075 if (CSSValue* keyword = parseKeywordValue(propertyID, string, parserMode)) | 1075 if (CSSValue* keyword = parseKeywordValue(propertyID, string, parserMode)) |
| 1076 return keyword; | 1076 return keyword; |
| 1077 if (CSSValue* transform = parseSimpleTransform(propertyID, string)) | 1077 if (CSSValue* transform = parseSimpleTransform(propertyID, string)) |
| 1078 return transform; | 1078 return transform; |
| 1079 return nullptr; | 1079 return nullptr; |
| 1080 } | 1080 } |
| 1081 | 1081 |
| 1082 } // namespace blink | 1082 } // namespace blink |
| OLD | NEW |