| 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/CSSParser.h" | 5 #include "core/css/parser/CSSParser.h" |
| 6 | 6 |
| 7 #include "core/css/CSSColorValue.h" | 7 #include "core/css/CSSColorValue.h" |
| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 bool CSSParser::parseSystemColor(Color& color, const String& colorString) | 159 bool CSSParser::parseSystemColor(Color& color, const String& colorString) |
| 160 { | 160 { |
| 161 CSSValueID id = cssValueKeywordID(colorString); | 161 CSSValueID id = cssValueKeywordID(colorString); |
| 162 if (!CSSPropertyParser::isSystemColor(id)) | 162 if (!CSSPropertyParser::isSystemColor(id)) |
| 163 return false; | 163 return false; |
| 164 | 164 |
| 165 color = LayoutTheme::theme().systemColor(id); | 165 color = LayoutTheme::theme().systemColor(id); |
| 166 return true; | 166 return true; |
| 167 } | 167 } |
| 168 | 168 |
| 169 CSSValue* CSSParser::parseFontFaceDescriptor(CSSPropertyID propertyID, const Str
ing& propertyValue, const CSSParserContext& context) | 169 const CSSValue* CSSParser::parseFontFaceDescriptor(CSSPropertyID propertyID, con
st String& propertyValue, const CSSParserContext& context) |
| 170 { | 170 { |
| 171 StringBuilder builder; | 171 StringBuilder builder; |
| 172 builder.append("@font-face { "); | 172 builder.append("@font-face { "); |
| 173 builder.append(getPropertyNameString(propertyID)); | 173 builder.append(getPropertyNameString(propertyID)); |
| 174 builder.append(" : "); | 174 builder.append(" : "); |
| 175 builder.append(propertyValue); | 175 builder.append(propertyValue); |
| 176 builder.append("; }"); | 176 builder.append("; }"); |
| 177 StyleRuleBase* rule = parseRule(context, nullptr, builder.toString()); | 177 StyleRuleBase* rule = parseRule(context, nullptr, builder.toString()); |
| 178 if (!rule || !rule->isFontFaceRule()) | 178 if (!rule || !rule->isFontFaceRule()) |
| 179 return nullptr; | 179 return nullptr; |
| 180 return toStyleRuleFontFace(rule)->properties().getPropertyCSSValue(propertyI
D); | 180 return toStyleRuleFontFace(rule)->properties().getPropertyCSSValue(propertyI
D); |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace blink | 183 } // namespace blink |
| OLD | NEW |