| 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/StylePropertySet.h" | 10 #include "core/css/StylePropertySet.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 PassRefPtrWillBeRawPtr<StyleRuleBase> CSSParser::parseRule(const CSSParserContex
t& context, const String& rule) | 39 PassRefPtrWillBeRawPtr<StyleRuleBase> CSSParser::parseRule(const CSSParserContex
t& context, const String& rule) |
| 40 { | 40 { |
| 41 return CSSParserImpl::parseRule(rule, context, CSSParserImpl::AllowImportRul
es); | 41 return CSSParserImpl::parseRule(rule, context, CSSParserImpl::AllowImportRul
es); |
| 42 } | 42 } |
| 43 | 43 |
| 44 void CSSParser::parseSheet(const CSSParserContext& context, StyleSheetContents*
styleSheet, const String& text) | 44 void CSSParser::parseSheet(const CSSParserContext& context, StyleSheetContents*
styleSheet, const String& text) |
| 45 { | 45 { |
| 46 return CSSParserImpl::parseStyleSheet(text, context, styleSheet); | 46 return CSSParserImpl::parseStyleSheet(text, context, styleSheet); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void CSSParser::parseSheetForInspector(const CSSParserContext& context, const St
ring& text, CSSParserObserver& observer) | 49 void CSSParser::parseSheetForInspector(const CSSParserContext& context, StyleShe
etContents* styleSheet, const String& text, CSSParserObserver& observer) |
| 50 { | 50 { |
| 51 return CSSParserImpl::parseStyleSheetForInspector(text, context, observer); | 51 return CSSParserImpl::parseStyleSheetForInspector(text, context, styleSheet,
observer); |
| 52 } | 52 } |
| 53 | 53 |
| 54 bool CSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID u
nresolvedProperty, const String& string, bool important, CSSParserMode parserMod
e, StyleSheetContents* styleSheet) | 54 bool CSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID u
nresolvedProperty, const String& string, bool important, CSSParserMode parserMod
e, StyleSheetContents* styleSheet) |
| 55 { | 55 { |
| 56 if (string.isEmpty()) | 56 if (string.isEmpty()) |
| 57 return false; | 57 return false; |
| 58 CSSPropertyID resolvedProperty = resolveCSSPropertyID(unresolvedProperty); | 58 CSSPropertyID resolvedProperty = resolveCSSPropertyID(unresolvedProperty); |
| 59 RefPtrWillBeRawPtr<CSSValue> value = CSSParserFastPaths::maybeParseValue(res
olvedProperty, string, parserMode); | 59 RefPtrWillBeRawPtr<CSSValue> value = CSSParserFastPaths::maybeParseValue(res
olvedProperty, string, parserMode); |
| 60 if (value) | 60 if (value) |
| 61 return declaration->setProperty(CSSProperty(resolvedProperty, value.rele
ase(), important)); | 61 return declaration->setProperty(CSSProperty(resolvedProperty, value.rele
ase(), important)); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 builder.appendLiteral(" : "); | 167 builder.appendLiteral(" : "); |
| 168 builder.append(propertyValue); | 168 builder.append(propertyValue); |
| 169 builder.appendLiteral("; }"); | 169 builder.appendLiteral("; }"); |
| 170 RefPtrWillBeRawPtr<StyleRuleBase> rule = parseRule(context, builder.toString
()); | 170 RefPtrWillBeRawPtr<StyleRuleBase> rule = parseRule(context, builder.toString
()); |
| 171 if (!rule || !rule->isFontFaceRule()) | 171 if (!rule || !rule->isFontFaceRule()) |
| 172 return nullptr; | 172 return nullptr; |
| 173 return toStyleRuleFontFace(rule.get())->properties().getPropertyCSSValue(pro
pertyID); | 173 return toStyleRuleFontFace(rule.get())->properties().getPropertyCSSValue(pro
pertyID); |
| 174 } | 174 } |
| 175 | 175 |
| 176 } // namespace blink | 176 } // namespace blink |
| OLD | NEW |