コード例 #1
0
JSValue* JSHTMLButtonElement::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case FormAttrNum: {
        HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(impl());

        return toJS(exec, WTF::getPtr(imp->form()));
    }
    case AccessKeyAttrNum: {
        HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(impl());

        return jsString(imp->accessKey());
    }
    case DisabledAttrNum: {
        HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(impl());

        return jsBoolean(imp->disabled());
    }
    case NameAttrNum: {
        HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(impl());

        return jsString(imp->name());
    }
    case TabIndexAttrNum: {
        HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(impl());

        return jsNumber(imp->tabIndex());
    }
    case TypeAttrNum: {
        HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(impl());

        return jsString(imp->type());
    }
    case ValueAttrNum: {
        HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(impl());

        return jsString(imp->value());
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
static v8::Handle<v8::Value> formAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    HTMLButtonElement* imp = V8HTMLButtonElement::toNative(info.Holder());
    return toV8Fast(imp->form(), info, imp);
}