static void disabledAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
    HTMLButtonElement* imp = V8HTMLButtonElement::toNative(info.Holder());
    bool v = value->BooleanValue();
    imp->setBooleanAttribute(WebCore::HTMLNames::disabledAttr, v);
    return;
}
void JSHTMLButtonElement::putValueProperty(ExecState* exec, int token, JSValue* value)
{
    switch (token) {
    case AccessKeyAttrNum: {
        HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(impl());
        imp->setAccessKey(valueToStringWithNullCheck(exec, value));
        break;
    }
    case DisabledAttrNum: {
        HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(impl());
        imp->setDisabled(value->toBoolean(exec));
        break;
    }
    case AutofocusAttrNum: {
        HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(impl());
        imp->setAutofocus(value->toBoolean(exec));
        break;
    }
    case NameAttrNum: {
        HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(impl());
        imp->setName(valueToStringWithNullCheck(exec, value));
        break;
    }
    case ValueAttrNum: {
        HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(impl());
        imp->setValue(valueToStringWithNullCheck(exec, value));
        break;
    }
    }
}
static void typeAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
    HTMLButtonElement* imp = V8HTMLButtonElement::toNative(info.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, v, value);
    imp->setType(v);
    return;
}
static v8::Handle<v8::Value> setCustomValidityCallback(const v8::Arguments& args)
{
    if (args.Length() < 1)
        return throwNotEnoughArgumentsError(args.GetIsolate());
    HTMLButtonElement* imp = V8HTMLButtonElement::toNative(args.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<WithUndefinedOrNullCheck>, error, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
    imp->setCustomValidity(error);
    return v8Undefined();
}
JSValue* jsHTMLButtonElementPrototypeFunctionClick(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
{
    if (!thisValue->isObject(&JSHTMLButtonElement::s_info))
        return throwError(exec, TypeError);
    JSHTMLButtonElement* castedThisObj = static_cast<JSHTMLButtonElement*>(thisValue);
    HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(castedThisObj->impl());

    imp->click();
    return jsUndefined();
}
Esempio n. 6
0
JSValue JSC_HOST_CALL jsHTMLButtonElementPrototypeFunctionClick(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
{
    UNUSED_PARAM(args);
    if (!thisValue.isObject(&JSHTMLButtonElement::s_info))
        return throwError(exec, TypeError);
    JSHTMLButtonElement* castedThisObj = static_cast<JSHTMLButtonElement*>(asObject(thisValue));
    HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(castedThisObj->impl());

    imp->click();
    return jsUndefined();
}
Esempio n. 7
0
JSValue* JSHTMLButtonElementPrototypeFunction::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
{
    if (!thisObj->inherits(&JSHTMLButtonElement::info))
      return throwError(exec, TypeError);

    HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(static_cast<JSHTMLButtonElement*>(thisObj)->impl());

    switch (id) {
    case JSHTMLButtonElement::ClickFuncNum: {

        imp->click();
        return jsUndefined();
    }
    }
    return 0;
}
static v8::Handle<v8::Value> checkValidityCallback(const v8::Arguments& args)
{
    HTMLButtonElement* imp = V8HTMLButtonElement::toNative(args.Holder());
    return v8Boolean(imp->checkValidity(), args.GetIsolate());
}
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(exec, imp->accessKey());
    }
    case DisabledAttrNum: {
        HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(impl());
        return jsBoolean(imp->disabled());
    }
    case AutofocusAttrNum: {
        HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(impl());
        return jsBoolean(imp->autofocus());
    }
    case NameAttrNum: {
        HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(impl());
        return jsString(exec, imp->name());
    }
    case TypeAttrNum: {
        HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(impl());
        return jsString(exec, imp->type());
    }
    case ValueAttrNum: {
        HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(impl());
        return jsString(exec, imp->value());
    }
    case WillValidateAttrNum: {
        HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(impl());
        return jsBoolean(imp->willValidate());
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
Esempio n. 10
0
void setJSHTMLButtonElementAutofocus(ExecState* exec, JSObject* thisObject, JSValue value)
{
    HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(static_cast<JSHTMLButtonElement*>(thisObject)->impl());
    imp->setAutofocus(value.toBoolean(exec));
}
Esempio n. 11
0
void setJSHTMLButtonElementValue(ExecState* exec, JSObject* thisObject, JSValue value)
{
    HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(static_cast<JSHTMLButtonElement*>(thisObject)->impl());
    imp->setValue(valueToStringWithNullCheck(exec, value));
}
Esempio n. 12
0
JSValue jsHTMLButtonElementValue(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    UNUSED_PARAM(exec);
    HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(static_cast<JSHTMLButtonElement*>(asObject(slot.slotBase()))->impl());
    return jsString(exec, imp->value());
}
Esempio n. 13
0
JSValue jsHTMLButtonElementWillValidate(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    UNUSED_PARAM(exec);
    HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(static_cast<JSHTMLButtonElement*>(asObject(slot.slotBase()))->impl());
    return jsBoolean(imp->willValidate());
}
static v8::Handle<v8::Value> willValidateAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    HTMLButtonElement* imp = V8HTMLButtonElement::toNative(info.Holder());
    return v8Boolean(imp->willValidate(), info.GetIsolate());
}
static v8::Handle<v8::Value> formEnctypeAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    HTMLButtonElement* imp = V8HTMLButtonElement::toNative(info.Holder());
    return v8String(imp->formEnctype(), info.GetIsolate());
}
static v8::Handle<v8::Value> formActionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    HTMLButtonElement* imp = V8HTMLButtonElement::toNative(info.Holder());
    return v8String(imp->getURLAttribute(WebCore::HTMLNames::formactionAttr), info.GetIsolate());
}
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);
}
static v8::Handle<v8::Value> disabledAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    HTMLButtonElement* imp = V8HTMLButtonElement::toNative(info.Holder());
    return v8Boolean(imp->fastHasAttribute(WebCore::HTMLNames::disabledAttr), info.GetIsolate());
}