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" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 cssColor.init(colorString); | 169 cssColor.init(colorString); |
170 CSSValueID id = cssValueKeywordID(cssColor); | 170 CSSValueID id = cssValueKeywordID(cssColor); |
171 if (!CSSPropertyParser::isSystemColor(id)) | 171 if (!CSSPropertyParser::isSystemColor(id)) |
172 return false; | 172 return false; |
173 | 173 |
174 Color parsedColor = LayoutTheme::theme().systemColor(id); | 174 Color parsedColor = LayoutTheme::theme().systemColor(id); |
175 color = parsedColor.rgb(); | 175 color = parsedColor.rgb(); |
176 return true; | 176 return true; |
177 } | 177 } |
178 | 178 |
| 179 PassRefPtrWillBeRawPtr<CSSValue> CSSParser::parseFontFaceDescriptor(CSSPropertyI
D propertyID, const String& propertyValue, const CSSParserContext& context) |
| 180 { |
| 181 StringBuilder builder; |
| 182 builder.appendLiteral("@font-face { "); |
| 183 builder.append(getPropertyNameString(propertyID)); |
| 184 builder.appendLiteral(" : "); |
| 185 builder.append(propertyValue); |
| 186 builder.appendLiteral("; }"); |
| 187 RefPtrWillBeRawPtr<StyleRuleBase> rule = parseRule(context, 0, builder.toStr
ing()); |
| 188 if (!rule || !rule->isFontFaceRule()) |
| 189 return nullptr; |
| 190 return toStyleRuleFontFace(rule.get())->properties().getPropertyCSSValue(pro
pertyID); |
| 191 } |
| 192 |
179 } // namespace blink | 193 } // namespace blink |
OLD | NEW |