Example #1
0
JSValue* jsKeyboardEventPrototypeFunctionInitKeyboardEvent(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
{
    if (!thisValue->isObject(&JSKeyboardEvent::s_info))
        return throwError(exec, TypeError);
    JSKeyboardEvent* castedThisObj = static_cast<JSKeyboardEvent*>(thisValue);
    KeyboardEvent* imp = static_cast<KeyboardEvent*>(castedThisObj->impl());
    const UString& type = args[0]->toString(exec);
    bool canBubble = args[1]->toBoolean(exec);
    bool cancelable = args[2]->toBoolean(exec);
    DOMWindow* view = toDOMWindow(args[3]);
    const UString& keyIdentifier = args[4]->toString(exec);
    unsigned keyLocation = args[5]->toInt32(exec);
    bool ctrlKey = args[6]->toBoolean(exec);
    bool altKey = args[7]->toBoolean(exec);
    bool shiftKey = args[8]->toBoolean(exec);
    bool metaKey = args[9]->toBoolean(exec);
    bool altGraphKey = args[10]->toBoolean(exec);

    imp->initKeyboardEvent(type, canBubble, cancelable, view, keyIdentifier, keyLocation, ctrlKey, altKey, shiftKey, metaKey, altGraphKey);
    return jsUndefined();
}
Example #2
0
JSValue JSC_HOST_CALL jsKeyboardEventPrototypeFunctionInitKeyboardEvent(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
{
    UNUSED_PARAM(args);
    if (!thisValue.inherits(&JSKeyboardEvent::s_info))
        return throwError(exec, TypeError);
    JSKeyboardEvent* castedThisObj = static_cast<JSKeyboardEvent*>(asObject(thisValue));
    KeyboardEvent* imp = static_cast<KeyboardEvent*>(castedThisObj->impl());
    const UString& type = args.at(0).toString(exec);
    bool canBubble = args.at(1).toBoolean(exec);
    bool cancelable = args.at(2).toBoolean(exec);
    DOMWindow* view = toDOMWindow(args.at(3));
    const UString& keyIdentifier = args.at(4).toString(exec);
    unsigned keyLocation = args.at(5).toInt32(exec);
    bool ctrlKey = args.at(6).toBoolean(exec);
    bool altKey = args.at(7).toBoolean(exec);
    bool shiftKey = args.at(8).toBoolean(exec);
    bool metaKey = args.at(9).toBoolean(exec);
    bool altGraphKey = args.at(10).toBoolean(exec);

    imp->initKeyboardEvent(type, canBubble, cancelable, view, keyIdentifier, keyLocation, ctrlKey, altKey, shiftKey, metaKey, altGraphKey);
    return jsUndefined();
}