Index: Source/core/css/FontFace.cpp |
diff --git a/Source/core/css/FontFace.cpp b/Source/core/css/FontFace.cpp |
index 1a251730b35858aa4876e7655cedf46d1544635b..f61d991f688da6bb5e7cee5c0d78a0c278d9d42f 100644 |
--- a/Source/core/css/FontFace.cpp |
+++ b/Source/core/css/FontFace.cpp |
@@ -65,7 +65,16 @@ namespace blink { |
static PassRefPtrWillBeRawPtr<CSSValue> parseCSSValue(const Document* document, const String& s, CSSPropertyID propertyID) |
{ |
CSSParserContext context(*document, UseCounter::getFrom(document)); |
- return CSSParser::parseSingleValue(propertyID, s, context); |
Timothy Loh
2015/05/04 02:05:18
I think this would look better if we exposed parse
|
+ StringBuilder builder; |
+ builder.appendLiteral("@font-face { "); |
+ builder.append(getPropertyNameString(propertyID)); |
+ builder.appendLiteral(" : "); |
+ builder.append(s); |
+ builder.appendLiteral("; }"); |
+ RefPtrWillBeRawPtr<StyleRuleBase> rule = CSSParser::parseRule(context, 0, builder.toString()); |
+ if (!rule || !rule->isFontFaceRule()) |
+ return nullptr; |
+ return toStyleRuleFontFace(rule.get())->properties().getPropertyCSSValue(propertyID); |
} |
PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, const AtomicString& family, StringOrArrayBufferOrArrayBufferView& source, const FontFaceDescriptors& descriptors) |