Ejemplo n.º 1
0
JSValue jsDOMSelectionExtentNode(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSDOMSelection* castedThis = static_cast<JSDOMSelection*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    DOMSelection* imp = static_cast<DOMSelection*>(castedThis->impl());
    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->extentNode()));
    return result;
}
Ejemplo n.º 2
0
EncodedJSValue jsDOMSelectionConstructor(ExecState* exec, EncodedJSValue thisValue, EncodedJSValue, PropertyName)
{
    JSDOMSelection* domObject = jsDynamicCast<JSDOMSelection*>(JSValue::decode(thisValue));
    if (!domObject)
        return throwVMTypeError(exec);
    if (!domObject)
        return throwVMTypeError(exec);
    return JSValue::encode(JSDOMSelection::getConstructor(exec->vm(), domObject->globalObject()));
}
Ejemplo n.º 3
0
EncodedJSValue jsDOMSelectionExtentNode(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSDOMSelection* castedThis = jsDynamicCast<JSDOMSelection*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    DOMSelection& impl = castedThis->impl();
    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.extentNode()));
    return JSValue::encode(result);
}
Ejemplo n.º 4
0
EncodedJSValue JSC_HOST_CALL jsDOMSelectionPrototypeFunctionGetRangeAt(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSDOMSelection* castedThis = jsDynamicCast<JSDOMSelection*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSDOMSelection::info());
    DOMSelection& impl = castedThis->impl();
    ExceptionCode ec = 0;
    int index(toInt32(exec, exec->argument(0), NormalConversion));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());

    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.getRangeAt(index, ec)));
    setDOMException(exec, ec);
    return JSValue::encode(result);
}
Ejemplo n.º 5
0
EncodedJSValue JSC_HOST_CALL jsDOMSelectionPrototypeFunctionGetRangeAt(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSDOMSelection::s_info))
        return throwVMTypeError(exec);
    JSDOMSelection* castedThis = static_cast<JSDOMSelection*>(asObject(thisValue));
    ASSERT_GC_OBJECT_INHERITS(castedThis, &JSDOMSelection::s_info);
    DOMSelection* imp = static_cast<DOMSelection*>(castedThis->impl());
    ExceptionCode ec = 0;
    int index(exec->argument(0).toInt32(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());


    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getRangeAt(index, ec)));
    setDOMException(exec, ec);
    return JSValue::encode(result);
}