Exemplo n.º 1
0
JSValue* JSCSSFontFaceRule::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case StyleAttrNum: {
        CSSFontFaceRule* imp = static_cast<CSSFontFaceRule*>(impl());
        return toJS(exec, WTF::getPtr(imp->style()));
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
static v8::Handle<v8::Value> styleAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    CSSFontFaceRule* imp = V8CSSFontFaceRule::toNative(info.Holder());
    RefPtr<CSSStyleDeclaration> result = imp->style();
    v8::Handle<v8::Value> wrapper = result.get() ? v8::Handle<v8::Value>(DOMDataStore::getWrapper(result.get(), info.GetIsolate())) : v8Undefined();
    if (wrapper.IsEmpty()) {
        wrapper = toV8(result.get(), info.Holder(), info.GetIsolate());
        if (!wrapper.IsEmpty())
            V8DOMWrapper::setNamedHiddenReference(info.Holder(), "style", wrapper);
    }
    return wrapper;
}
Exemplo n.º 3
0
 static v8::Handle<v8::Value> styleAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) {
   INC_STATS("DOM.CSSFontFaceRule.style._get");
   CSSFontFaceRule* imp = V8CSSFontFaceRule::toNative(info.Holder());
   return toV8(imp->style());
 }