示例#1
0
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();
}
示例#2
0
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();
}
示例#3
0
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);
}
示例#4
0
void FontFace::setFeatureSettings(ExecutionContext* context, const String& s, ExceptionState& exceptionState)
{
    setPropertyFromString(toDocument(context), s, CSSPropertyFontFeatureSettings, &exceptionState);
}
示例#5
0
void FontFace::setVariant(ExecutionContext* context, const String& s, ExceptionState& exceptionState)
{
    setPropertyFromString(toDocument(context), s, CSSPropertyFontVariant, &exceptionState);
}
示例#6
0
void FontFace::setUnicodeRange(ExecutionContext* context, const String& s, ExceptionState& exceptionState)
{
    setPropertyFromString(toDocument(context), s, CSSPropertyUnicodeRange, &exceptionState);
}
示例#7
0
void FontFace::setFeatureSettings(const String& s, ExceptionState& es)
{
    setPropertyFromString(s, CSSPropertyWebkitFontFeatureSettings, es);
}
示例#8
0
void FontFace::setVariant(const String& s, ExceptionState& es)
{
    setPropertyFromString(s, CSSPropertyFontVariant, es);
}
示例#9
0
void FontFace::setUnicodeRange(const String& s, ExceptionState& es)
{
    setPropertyFromString(s, CSSPropertyUnicodeRange, es);
}
示例#10
0
void FontFace::setStretch(const String& s, ExceptionState& es)
{
    setPropertyFromString(s, CSSPropertyFontStretch, es);
}