Esempio n. 1
0
JSValue jsSVGDocumentRootElement(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSSVGDocument* castedThis = static_cast<JSSVGDocument*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    SVGDocument* imp = static_cast<SVGDocument*>(castedThis->impl());
    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->rootElement()));
    return result;
}
Esempio n. 2
0
EncodedJSValue JSC_HOST_CALL jsSVGDocumentPrototypeFunctionCreateEvent(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSSVGDocument::s_info))
        return throwVMTypeError(exec);
    JSSVGDocument* castedThis = static_cast<JSSVGDocument*>(asObject(thisValue));
    SVGDocument* imp = static_cast<SVGDocument*>(castedThis->impl());
    ExceptionCode ec = 0;
    const String& eventType(ustringToString(exec->argument(0).toString(exec)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());


    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->createEvent(eventType, ec)));
    setDOMException(exec, ec);
    return JSValue::encode(result);
}
Esempio n. 3
0
JSValue jsSVGDocumentConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSSVGDocument* domObject = static_cast<JSSVGDocument*>(asObject(slotBase));
    return JSSVGDocument::getConstructor(exec, domObject->globalObject());
}