| Index: Source/core/css/FontFace.cpp
|
| diff --git a/Source/core/css/FontFace.cpp b/Source/core/css/FontFace.cpp
|
| index c4bc50ab9f069a746d2e54914d89cdb74ac627ca..7ad56554e37f68acf6b40df010779154bc74f1cb 100644
|
| --- a/Source/core/css/FontFace.cpp
|
| +++ b/Source/core/css/FontFace.cpp
|
| @@ -31,7 +31,6 @@
|
| #include "config.h"
|
| #include "core/css/FontFace.h"
|
|
|
| -#include "bindings/core/v8/Dictionary.h"
|
| #include "bindings/core/v8/ExceptionState.h"
|
| #include "bindings/core/v8/ScriptPromiseResolver.h"
|
| #include "bindings/core/v8/ScriptState.h"
|
| @@ -103,47 +102,34 @@ static PassRefPtrWillBeRawPtr<CSSValue> parseCSSValue(const Document* document,
|
| return parsedStyle->getPropertyCSSValue(propertyID);
|
| }
|
|
|
| -static bool initFontFace(FontFace* fontFace, ExecutionContext* context, const AtomicString& family, const Dictionary& descriptors, ExceptionState& exceptionState)
|
| +static bool initFontFace(FontFace* fontFace, ExecutionContext* context, const AtomicString& family, const FontFaceDescriptors* descriptors, ExceptionState& exceptionState)
|
| {
|
| fontFace->setFamily(context, family, exceptionState);
|
| if (exceptionState.hadException())
|
| return false;
|
|
|
| - String value;
|
| - if (DictionaryHelper::get(descriptors, "style", value)) {
|
| - fontFace->setStyle(context, value, exceptionState);
|
| - if (exceptionState.hadException())
|
| - return false;
|
| - }
|
| - if (DictionaryHelper::get(descriptors, "weight", value)) {
|
| - fontFace->setWeight(context, value, exceptionState);
|
| - if (exceptionState.hadException())
|
| - return false;
|
| - }
|
| - if (DictionaryHelper::get(descriptors, "stretch", value)) {
|
| - fontFace->setStretch(context, value, exceptionState);
|
| - if (exceptionState.hadException())
|
| - return false;
|
| - }
|
| - if (DictionaryHelper::get(descriptors, "unicodeRange", value)) {
|
| - fontFace->setUnicodeRange(context, value, exceptionState);
|
| - if (exceptionState.hadException())
|
| - return false;
|
| - }
|
| - if (DictionaryHelper::get(descriptors, "variant", value)) {
|
| - fontFace->setVariant(context, value, exceptionState);
|
| - if (exceptionState.hadException())
|
| - return false;
|
| - }
|
| - if (DictionaryHelper::get(descriptors, "featureSettings", value)) {
|
| - fontFace->setFeatureSettings(context, value, exceptionState);
|
| - if (exceptionState.hadException())
|
| - return false;
|
| - }
|
| + fontFace->setStyle(context, descriptors->style(), exceptionState);
|
| + if (exceptionState.hadException())
|
| + return false;
|
| + fontFace->setWeight(context, descriptors->weight(), exceptionState);
|
| + if (exceptionState.hadException())
|
| + return false;
|
| + fontFace->setStretch(context, descriptors->stretch(), exceptionState);
|
| + if (exceptionState.hadException())
|
| + return false;
|
| + fontFace->setUnicodeRange(context, descriptors->unicodeRange(), exceptionState);
|
| + if (exceptionState.hadException())
|
| + return false;
|
| + fontFace->setVariant(context, descriptors->variant(), exceptionState);
|
| + if (exceptionState.hadException())
|
| + return false;
|
| + fontFace->setFeatureSettings(context, descriptors->featureSettings(), exceptionState);
|
| + if (exceptionState.hadException())
|
| + return false;
|
| return true;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, const AtomicString& family, const String& source, const Dictionary& descriptors, ExceptionState& exceptionState)
|
| +PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, const AtomicString& family, const String& source, const FontFaceDescriptors* descriptors, ExceptionState& exceptionState)
|
| {
|
| RefPtrWillBeRawPtr<CSSValue> src = parseCSSValue(toDocument(context), source, CSSPropertySrc);
|
| if (!src || !src->isValueList()) {
|
| @@ -157,7 +143,7 @@ PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, con
|
| return fontFace.release();
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, const AtomicString& family, PassRefPtr<ArrayBuffer> source, const Dictionary& descriptors, ExceptionState& exceptionState)
|
| +PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, const AtomicString& family, PassRefPtr<ArrayBuffer> source, const FontFaceDescriptors* descriptors, ExceptionState& exceptionState)
|
| {
|
| RefPtrWillBeRawPtr<FontFace> fontFace = adoptRefWillBeNoop(new FontFace());
|
| if (initFontFace(fontFace.get(), context, family, descriptors, exceptionState))
|
| @@ -165,7 +151,7 @@ PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, con
|
| return fontFace.release();
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, const AtomicString& family, PassRefPtr<ArrayBufferView> source, const Dictionary& descriptors, ExceptionState& exceptionState)
|
| +PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, const AtomicString& family, PassRefPtr<ArrayBufferView> source, const FontFaceDescriptors* descriptors, ExceptionState& exceptionState)
|
| {
|
| RefPtrWillBeRawPtr<FontFace> fontFace = adoptRefWillBeNoop(new FontFace());
|
| if (initFontFace(fontFace.get(), context, family, descriptors, exceptionState))
|
|
|