Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: Source/core/css/parser/CSSParser.cpp

Issue 1103273010: Add parseFontFaceDescriptor for @font-face handling (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: V5 Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/css/parser/CSSParser.h ('k') | Source/core/css/parser/CSSPropertyParser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « Source/core/css/parser/CSSParser.h ('k') | Source/core/css/parser/CSSPropertyParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698