| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/css/parser/CSSParser.h" | 6 #include "core/css/parser/CSSParser.h" |
| 7 | 7 |
| 8 #include "core/css/CSSKeyframeRule.h" | 8 #include "core/css/CSSKeyframeRule.h" |
| 9 #include "core/css/StyleColor.h" | 9 #include "core/css/StyleColor.h" |
| 10 #include "core/css/StyleRule.h" | 10 #include "core/css/StyleRule.h" |
| 11 #include "core/css/StyleSheetContents.h" | 11 #include "core/css/StyleSheetContents.h" |
| 12 #include "core/css/parser/CSSParserFastPaths.h" | 12 #include "core/css/parser/CSSParserFastPaths.h" |
| 13 #include "core/css/parser/CSSParserImpl.h" |
| 13 | 14 |
| 14 namespace blink { | 15 namespace blink { |
| 15 | 16 |
| 16 CSSParser::CSSParser(const CSSParserContext& context) | 17 CSSParser::CSSParser(const CSSParserContext& context) |
| 17 : m_bisonParser(context) | 18 : m_bisonParser(context) |
| 18 { | 19 { |
| 19 } | 20 } |
| 20 | 21 |
| 21 bool CSSParser::parseDeclaration(MutableStylePropertySet* propertySet, const Str
ing& declaration, CSSParserObserver* observer, StyleSheetContents* styleSheet) | 22 bool CSSParser::parseDeclaration(MutableStylePropertySet* propertySet, const Str
ing& declaration, CSSParserObserver* observer, StyleSheetContents* styleSheet) |
| 22 { | 23 { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 45 CSSParserContext context(parserMode, 0); | 46 CSSParserContext context(parserMode, 0); |
| 46 if (styleSheet) { | 47 if (styleSheet) { |
| 47 context = styleSheet->parserContext(); | 48 context = styleSheet->parserContext(); |
| 48 context.setMode(parserMode); | 49 context.setMode(parserMode); |
| 49 } | 50 } |
| 50 return parseValue(declaration, propertyID, string, important, context); | 51 return parseValue(declaration, propertyID, string, important, context); |
| 51 } | 52 } |
| 52 | 53 |
| 53 bool CSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID p
ropertyID, const String& string, bool important, const CSSParserContext& context
) | 54 bool CSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID p
ropertyID, const String& string, bool important, const CSSParserContext& context
) |
| 54 { | 55 { |
| 56 if (RuntimeEnabledFeatures::newCSSParserEnabled()) |
| 57 return CSSParserImpl::parseValue(declaration, propertyID, string, import
ant, context); |
| 55 return BisonCSSParser::parseValue(declaration, propertyID, string, important
, context); | 58 return BisonCSSParser::parseValue(declaration, propertyID, string, important
, context); |
| 56 } | 59 } |
| 57 | 60 |
| 58 bool CSSParser::parseFastPath(MutableStylePropertySet* declaration, CSSPropertyI
D propertyID, const String& string, bool important, CSSParserMode parserMode) | 61 bool CSSParser::parseFastPath(MutableStylePropertySet* declaration, CSSPropertyI
D propertyID, const String& string, bool important, CSSParserMode parserMode) |
| 59 { | 62 { |
| 60 RefPtrWillBeRawPtr<CSSValue> value = CSSParserFastPaths::maybeParseValue(pro
pertyID, string, parserMode); | 63 RefPtrWillBeRawPtr<CSSValue> value = CSSParserFastPaths::maybeParseValue(pro
pertyID, string, parserMode); |
| 61 if (!value) | 64 if (!value) |
| 62 return false; | 65 return false; |
| 63 declaration->addParsedProperty(CSSProperty(propertyID, value.release(), impo
rtant)); | 66 declaration->addParsedProperty(CSSProperty(propertyID, value.release(), impo
rtant)); |
| 64 return true; | 67 return true; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 { | 107 { |
| 105 return BisonCSSParser::colorFromRGBColorString(string); | 108 return BisonCSSParser::colorFromRGBColorString(string); |
| 106 } | 109 } |
| 107 | 110 |
| 108 bool CSSParser::parseSystemColor(RGBA32& color, const String& colorString) | 111 bool CSSParser::parseSystemColor(RGBA32& color, const String& colorString) |
| 109 { | 112 { |
| 110 return BisonCSSParser::parseSystemColor(color, colorString); | 113 return BisonCSSParser::parseSystemColor(color, colorString); |
| 111 } | 114 } |
| 112 | 115 |
| 113 } // namespace blink | 116 } // namespace blink |
| OLD | NEW |