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

Unified 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, 8 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/parser/CSSParser.cpp
diff --git a/Source/core/css/parser/CSSParser.cpp b/Source/core/css/parser/CSSParser.cpp
index 764412343b51a10a43d198581c1fcf323886d5a8..58d12275e2ee71ac52bbec7f1385806071459281 100644
--- a/Source/core/css/parser/CSSParser.cpp
+++ b/Source/core/css/parser/CSSParser.cpp
@@ -176,4 +176,18 @@ bool CSSParser::parseSystemColor(RGBA32& color, const String& colorString)
return true;
}
+PassRefPtrWillBeRawPtr<CSSValue> CSSParser::parseFontFaceDescriptor(CSSPropertyID propertyID, const String& propertyValue, const CSSParserContext& context)
+{
+ StringBuilder builder;
+ builder.appendLiteral("@font-face { ");
+ builder.append(getPropertyNameString(propertyID));
+ builder.appendLiteral(" : ");
+ builder.append(propertyValue);
+ builder.appendLiteral("; }");
+ RefPtrWillBeRawPtr<StyleRuleBase> rule = parseRule(context, 0, builder.toString());
+ if (!rule || !rule->isFontFaceRule())
+ return nullptr;
+ return toStyleRuleFontFace(rule.get())->properties().getPropertyCSSValue(propertyID);
+}
+
} // namespace blink
« 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