EncodedJSValue JSC_HOST_CALL jsDOMImplementationPrototypeFunctionCreateHTMLDocument(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSDOMImplementation::s_info)) return throwVMTypeError(exec); JSDOMImplementation* castedThis = static_cast<JSDOMImplementation*>(asObject(thisValue)); DOMImplementation* imp = static_cast<DOMImplementation*>(castedThis->impl()); const String& title = ustringToString(exec->argument(0).toString(exec)); JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->createHTMLDocument(title))); return JSValue::encode(result); }
JSValue JSC_HOST_CALL jsDOMImplementationPrototypeFunctionCreateHTMLDocument(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) { UNUSED_PARAM(args); if (!thisValue.inherits(&JSDOMImplementation::s_info)) return throwError(exec, TypeError); JSDOMImplementation* castedThisObj = static_cast<JSDOMImplementation*>(asObject(thisValue)); DOMImplementation* imp = static_cast<DOMImplementation*>(castedThisObj->impl()); const UString& title = args.at(0).toString(exec); JSC::JSValue result = toJS(exec, castedThisObj->globalObject(), WTF::getPtr(imp->createHTMLDocument(title))); return result; }
EncodedJSValue JSC_HOST_CALL jsDOMImplementationPrototypeFunctionCreateDocument(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSDOMImplementation::s_info)) return throwVMTypeError(exec); JSDOMImplementation* castedThis = static_cast<JSDOMImplementation*>(asObject(thisValue)); DOMImplementation* imp = static_cast<DOMImplementation*>(castedThis->impl()); ExceptionCode ec = 0; const String& namespaceURI = valueToStringWithNullCheck(exec, exec->argument(0)); const String& qualifiedName = valueToStringWithNullCheck(exec, exec->argument(1)); DocumentType* doctype = toDocumentType(exec->argument(2)); JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->createDocument(namespaceURI, qualifiedName, doctype, ec))); setDOMException(exec, ec); return JSValue::encode(result); }
EncodedJSValue JSC_HOST_CALL jsDOMImplementationPrototypeFunctionCreateCSSStyleSheet(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSDOMImplementation::s_info)) return throwVMTypeError(exec); JSDOMImplementation* castedThis = static_cast<JSDOMImplementation*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSDOMImplementation::s_info); DOMImplementation* imp = static_cast<DOMImplementation*>(castedThis->impl()); ExceptionCode ec = 0; const String& title(ustringToString(exec->argument(0).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); const String& media(ustringToString(exec->argument(1).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->createCSSStyleSheet(title, media, ec))); setDOMException(exec, ec); return JSValue::encode(result); }
EncodedJSValue JSC_HOST_CALL jsDOMImplementationPrototypeFunctionCreateDocumentType(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSDOMImplementation::s_info)) return throwVMTypeError(exec); JSDOMImplementation* castedThis = static_cast<JSDOMImplementation*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSDOMImplementation::s_info); DOMImplementation* imp = static_cast<DOMImplementation*>(castedThis->impl()); ExceptionCode ec = 0; const String& qualifiedName(valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0))); if (exec->hadException()) return JSValue::encode(jsUndefined()); const String& publicId(valueToStringWithUndefinedOrNullCheck(exec, exec->argument(1))); if (exec->hadException()) return JSValue::encode(jsUndefined()); const String& systemId(valueToStringWithUndefinedOrNullCheck(exec, exec->argument(2))); if (exec->hadException()) return JSValue::encode(jsUndefined()); JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->createDocumentType(qualifiedName, publicId, systemId, ec))); setDOMException(exec, ec); return JSValue::encode(result); }
JSValue jsDOMImplementationConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSDOMImplementation* domObject = static_cast<JSDOMImplementation*>(asObject(slotBase)); return JSDOMImplementation::getConstructor(exec, domObject->globalObject()); }