FontFace::FontFace(ExecutionContext* context, const AtomicString& family, const FontFaceDescriptors& descriptors) : ActiveDOMObject(context) , m_family(family) , m_status(Unloaded) { Document* document = toDocument(context); setPropertyFromString(document, descriptors.style(), CSSPropertyFontStyle); setPropertyFromString(document, descriptors.weight(), CSSPropertyFontWeight); // FIXME: we don't implement 'font-strech' property yet so we can't set the property. setPropertyFromString(document, descriptors.unicodeRange(), CSSPropertyUnicodeRange); setPropertyFromString(document, descriptors.variant(), CSSPropertyFontVariant); setPropertyFromString(document, descriptors.featureSettings(), CSSPropertyWebkitFontFeatureSettings); suspendIfNeeded(); }
FontFace::FontFace(ExecutionContext* context, const AtomicString& family, const FontFaceDescriptors& descriptors) : ActiveDOMObject(context) , m_family(family) , m_status(Unloaded) { Document* document = toDocument(context); setPropertyFromString(document, descriptors.style(), CSSPropertyFontStyle); setPropertyFromString(document, descriptors.weight(), CSSPropertyFontWeight); setPropertyFromString(document, descriptors.stretch(), CSSPropertyFontStretch); setPropertyFromString(document, descriptors.unicodeRange(), CSSPropertyUnicodeRange); setPropertyFromString(document, descriptors.variant(), CSSPropertyFontVariant); setPropertyFromString(document, descriptors.featureSettings(), CSSPropertyFontFeatureSettings); suspendIfNeeded(); }
FontFace::FontFace(ExecutionContext* context, const AtomicString& family, const Dictionary& descriptors) : m_family(family) , m_status(Unloaded) { ScriptWrappable::init(this); Document* document = toDocument(context); String value; if (DictionaryHelper::get(descriptors, "style", value)) setPropertyFromString(document, value, CSSPropertyFontStyle); if (DictionaryHelper::get(descriptors, "weight", value)) setPropertyFromString(document, value, CSSPropertyFontWeight); if (DictionaryHelper::get(descriptors, "stretch", value)) setPropertyFromString(document, value, CSSPropertyFontStretch); if (DictionaryHelper::get(descriptors, "unicodeRange", value)) setPropertyFromString(document, value, CSSPropertyUnicodeRange); if (DictionaryHelper::get(descriptors, "variant", value)) setPropertyFromString(document, value, CSSPropertyFontVariant); if (DictionaryHelper::get(descriptors, "featureSettings", value)) setPropertyFromString(document, value, CSSPropertyWebkitFontFeatureSettings); }
void FontFace::setFeatureSettings(ExecutionContext* context, const String& s, ExceptionState& exceptionState) { setPropertyFromString(toDocument(context), s, CSSPropertyFontFeatureSettings, &exceptionState); }
void FontFace::setVariant(ExecutionContext* context, const String& s, ExceptionState& exceptionState) { setPropertyFromString(toDocument(context), s, CSSPropertyFontVariant, &exceptionState); }
void FontFace::setUnicodeRange(ExecutionContext* context, const String& s, ExceptionState& exceptionState) { setPropertyFromString(toDocument(context), s, CSSPropertyUnicodeRange, &exceptionState); }
void FontFace::setFeatureSettings(const String& s, ExceptionState& es) { setPropertyFromString(s, CSSPropertyWebkitFontFeatureSettings, es); }
void FontFace::setVariant(const String& s, ExceptionState& es) { setPropertyFromString(s, CSSPropertyFontVariant, es); }
void FontFace::setUnicodeRange(const String& s, ExceptionState& es) { setPropertyFromString(s, CSSPropertyUnicodeRange, es); }
void FontFace::setStretch(const String& s, ExceptionState& es) { setPropertyFromString(s, CSSPropertyFontStretch, es); }