/* This file is part of the WebKit open source project. This file has been generated by generate-bindings.pl. DO NOT MODIFY! This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include "JSHTMLObjectElement.h" #include "Document.h" #include "HTMLFormElement.h" #include "HTMLNames.h" #include "HTMLObjectElement.h" #include "JSDOMBinding.h" #include "JSDocument.h" #include "JSHTMLFormElement.h" #include "JSHTMLObjectElementCustom.h" #include "JSSVGDocument.h" #include "KURL.h" #include "SVGDocument.h" #include #include #include #include using namespace JSC; namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSHTMLObjectElement); /* Hash table */ static const HashTableValue JSHTMLObjectElementTableValues[21] = { { "form", DontDelete|ReadOnly, (intptr_t)static_cast(jsHTMLObjectElementForm), (intptr_t)0 }, { "code", DontDelete, (intptr_t)static_cast(jsHTMLObjectElementCode), (intptr_t)setJSHTMLObjectElementCode }, { "align", DontDelete, (intptr_t)static_cast(jsHTMLObjectElementAlign), (intptr_t)setJSHTMLObjectElementAlign }, { "archive", DontDelete, (intptr_t)static_cast(jsHTMLObjectElementArchive), (intptr_t)setJSHTMLObjectElementArchive }, { "border", DontDelete, (intptr_t)static_cast(jsHTMLObjectElementBorder), (intptr_t)setJSHTMLObjectElementBorder }, { "codeBase", DontDelete, (intptr_t)static_cast(jsHTMLObjectElementCodeBase), (intptr_t)setJSHTMLObjectElementCodeBase }, { "codeType", DontDelete, (intptr_t)static_cast(jsHTMLObjectElementCodeType), (intptr_t)setJSHTMLObjectElementCodeType }, { "data", DontDelete, (intptr_t)static_cast(jsHTMLObjectElementData), (intptr_t)setJSHTMLObjectElementData }, { "declare", DontDelete, (intptr_t)static_cast(jsHTMLObjectElementDeclare), (intptr_t)setJSHTMLObjectElementDeclare }, { "height", DontDelete, (intptr_t)static_cast(jsHTMLObjectElementHeight), (intptr_t)setJSHTMLObjectElementHeight }, { "hspace", DontDelete, (intptr_t)static_cast(jsHTMLObjectElementHspace), (intptr_t)setJSHTMLObjectElementHspace }, { "name", DontDelete, (intptr_t)static_cast(jsHTMLObjectElementName), (intptr_t)setJSHTMLObjectElementName }, { "standby", DontDelete, (intptr_t)static_cast(jsHTMLObjectElementStandby), (intptr_t)setJSHTMLObjectElementStandby }, { "type", DontDelete, (intptr_t)static_cast(jsHTMLObjectElementType), (intptr_t)setJSHTMLObjectElementType }, { "useMap", DontDelete, (intptr_t)static_cast(jsHTMLObjectElementUseMap), (intptr_t)setJSHTMLObjectElementUseMap }, { "vspace", DontDelete, (intptr_t)static_cast(jsHTMLObjectElementVspace), (intptr_t)setJSHTMLObjectElementVspace }, { "width", DontDelete, (intptr_t)static_cast(jsHTMLObjectElementWidth), (intptr_t)setJSHTMLObjectElementWidth }, { "willValidate", DontDelete|ReadOnly, (intptr_t)static_cast(jsHTMLObjectElementWillValidate), (intptr_t)0 }, { "contentDocument", DontDelete|ReadOnly, (intptr_t)static_cast(jsHTMLObjectElementContentDocument), (intptr_t)0 }, { "constructor", DontEnum|ReadOnly, (intptr_t)static_cast(jsHTMLObjectElementConstructor), (intptr_t)0 }, { 0, 0, 0, 0 } }; static JSC_CONST_HASHTABLE HashTable JSHTMLObjectElementTable = #if ENABLE(PERFECT_HASH_SIZE) { 127, JSHTMLObjectElementTableValues, 0 }; #else { 66, 63, JSHTMLObjectElementTableValues, 0 }; #endif /* Hash table for constructor */ static const HashTableValue JSHTMLObjectElementConstructorTableValues[1] = { { 0, 0, 0, 0 } }; static JSC_CONST_HASHTABLE HashTable JSHTMLObjectElementConstructorTable = #if ENABLE(PERFECT_HASH_SIZE) { 0, JSHTMLObjectElementConstructorTableValues, 0 }; #else { 1, 0, JSHTMLObjectElementConstructorTableValues, 0 }; #endif class JSHTMLObjectElementConstructor : public DOMConstructorObject { public: JSHTMLObjectElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) : DOMConstructorObject(JSHTMLObjectElementConstructor::createStructure(globalObject->objectPrototype()), globalObject) { putDirect(exec->propertyNames().prototype, JSHTMLObjectElementPrototype::self(exec, globalObject), None); } virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); virtual const ClassInfo* classInfo() const { return &s_info; } static const ClassInfo s_info; static PassRefPtr createStructure(JSValue proto) { return Structure::create(proto, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount); } protected: static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | DOMConstructorObject::StructureFlags; }; const ClassInfo JSHTMLObjectElementConstructor::s_info = { "HTMLObjectElementConstructor", 0, &JSHTMLObjectElementConstructorTable, 0 }; bool JSHTMLObjectElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot(exec, &JSHTMLObjectElementConstructorTable, this, propertyName, slot); } bool JSHTMLObjectElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor(exec, &JSHTMLObjectElementConstructorTable, this, propertyName, descriptor); } /* Hash table for prototype */ static const HashTableValue JSHTMLObjectElementPrototypeTableValues[2] = { { "getSVGDocument", DontDelete|Function, (intptr_t)static_cast(jsHTMLObjectElementPrototypeFunctionGetSVGDocument), (intptr_t)0 }, { 0, 0, 0, 0 } }; static JSC_CONST_HASHTABLE HashTable JSHTMLObjectElementPrototypeTable = #if ENABLE(PERFECT_HASH_SIZE) { 0, JSHTMLObjectElementPrototypeTableValues, 0 }; #else { 2, 1, JSHTMLObjectElementPrototypeTableValues, 0 }; #endif const ClassInfo JSHTMLObjectElementPrototype::s_info = { "HTMLObjectElementPrototype", 0, &JSHTMLObjectElementPrototypeTable, 0 }; JSObject* JSHTMLObjectElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype(exec, globalObject); } bool JSHTMLObjectElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticFunctionSlot(exec, &JSHTMLObjectElementPrototypeTable, this, propertyName, slot); } bool JSHTMLObjectElementPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticFunctionDescriptor(exec, &JSHTMLObjectElementPrototypeTable, this, propertyName, descriptor); } const ClassInfo JSHTMLObjectElement::s_info = { "HTMLObjectElement", &JSHTMLElement::s_info, &JSHTMLObjectElementTable, 0 }; JSHTMLObjectElement::JSHTMLObjectElement(NonNullPassRefPtr structure, JSDOMGlobalObject* globalObject, PassRefPtr impl) : JSHTMLElement(structure, globalObject, impl) { } JSObject* JSHTMLObjectElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return new (exec) JSHTMLObjectElementPrototype(JSHTMLObjectElementPrototype::createStructure(JSHTMLElementPrototype::self(exec, globalObject))); } bool JSHTMLObjectElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { if (getOwnPropertySlotDelegate(exec, propertyName, slot)) return true; return getStaticValueSlot(exec, &JSHTMLObjectElementTable, this, propertyName, slot); } bool JSHTMLObjectElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { if (getOwnPropertyDescriptorDelegate(exec, propertyName, descriptor)) return true; return getStaticValueDescriptor(exec, &JSHTMLObjectElementTable, this, propertyName, descriptor); } JSValue jsHTMLObjectElementForm(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLObjectElement* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); HTMLObjectElement* imp = static_cast(castedThis->impl()); JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->form())); return result; } JSValue jsHTMLObjectElementCode(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLObjectElement* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); HTMLObjectElement* imp = static_cast(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(HTMLNames::codeAttr)); return result; } JSValue jsHTMLObjectElementAlign(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLObjectElement* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); HTMLObjectElement* imp = static_cast(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(HTMLNames::alignAttr)); return result; } JSValue jsHTMLObjectElementArchive(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLObjectElement* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); HTMLObjectElement* imp = static_cast(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(HTMLNames::archiveAttr)); return result; } JSValue jsHTMLObjectElementBorder(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLObjectElement* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); HTMLObjectElement* imp = static_cast(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(HTMLNames::borderAttr)); return result; } JSValue jsHTMLObjectElementCodeBase(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLObjectElement* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); HTMLObjectElement* imp = static_cast(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(HTMLNames::codebaseAttr)); return result; } JSValue jsHTMLObjectElementCodeType(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLObjectElement* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); HTMLObjectElement* imp = static_cast(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(HTMLNames::codetypeAttr)); return result; } JSValue jsHTMLObjectElementData(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLObjectElement* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); HTMLObjectElement* imp = static_cast(castedThis->impl()); JSValue result = jsString(exec, imp->getURLAttribute(HTMLNames::dataAttr)); return result; } JSValue jsHTMLObjectElementDeclare(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLObjectElement* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); HTMLObjectElement* imp = static_cast(castedThis->impl()); JSValue result = jsBoolean(imp->declare()); return result; } JSValue jsHTMLObjectElementHeight(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLObjectElement* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); HTMLObjectElement* imp = static_cast(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(HTMLNames::heightAttr)); return result; } JSValue jsHTMLObjectElementHspace(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLObjectElement* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); HTMLObjectElement* imp = static_cast(castedThis->impl()); JSValue result = jsNumber(exec, imp->hspace()); return result; } JSValue jsHTMLObjectElementName(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLObjectElement* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); HTMLObjectElement* imp = static_cast(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(HTMLNames::nameAttr)); return result; } JSValue jsHTMLObjectElementStandby(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLObjectElement* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); HTMLObjectElement* imp = static_cast(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(HTMLNames::standbyAttr)); return result; } JSValue jsHTMLObjectElementType(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLObjectElement* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); HTMLObjectElement* imp = static_cast(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(HTMLNames::typeAttr)); return result; } JSValue jsHTMLObjectElementUseMap(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLObjectElement* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); HTMLObjectElement* imp = static_cast(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(HTMLNames::usemapAttr)); return result; } JSValue jsHTMLObjectElementVspace(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLObjectElement* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); HTMLObjectElement* imp = static_cast(castedThis->impl()); JSValue result = jsNumber(exec, imp->vspace()); return result; } JSValue jsHTMLObjectElementWidth(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLObjectElement* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); HTMLObjectElement* imp = static_cast(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(HTMLNames::widthAttr)); return result; } JSValue jsHTMLObjectElementWillValidate(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLObjectElement* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); HTMLObjectElement* imp = static_cast(castedThis->impl()); JSValue result = jsBoolean(imp->willValidate()); return result; } JSValue jsHTMLObjectElementContentDocument(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLObjectElement* castedThis = static_cast(asObject(slotBase)); HTMLObjectElement* imp = static_cast(castedThis->impl()); return checkNodeSecurity(exec, imp->contentDocument()) ? toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->contentDocument())) : jsUndefined(); } JSValue jsHTMLObjectElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLObjectElement* domObject = static_cast(asObject(slotBase)); return JSHTMLObjectElement::getConstructor(exec, domObject->globalObject()); } void JSHTMLObjectElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) { if (putDelegate(exec, propertyName, value, slot)) return; lookupPut(exec, propertyName, value, &JSHTMLObjectElementTable, this, slot); } void setJSHTMLObjectElementCode(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLObjectElement* castedThisObj = static_cast(thisObject); HTMLObjectElement* imp = static_cast(castedThisObj->impl()); imp->setAttribute(HTMLNames::codeAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLObjectElementAlign(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLObjectElement* castedThisObj = static_cast(thisObject); HTMLObjectElement* imp = static_cast(castedThisObj->impl()); imp->setAttribute(HTMLNames::alignAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLObjectElementArchive(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLObjectElement* castedThisObj = static_cast(thisObject); HTMLObjectElement* imp = static_cast(castedThisObj->impl()); imp->setAttribute(HTMLNames::archiveAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLObjectElementBorder(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLObjectElement* castedThisObj = static_cast(thisObject); HTMLObjectElement* imp = static_cast(castedThisObj->impl()); imp->setAttribute(HTMLNames::borderAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLObjectElementCodeBase(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLObjectElement* castedThisObj = static_cast(thisObject); HTMLObjectElement* imp = static_cast(castedThisObj->impl()); imp->setAttribute(HTMLNames::codebaseAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLObjectElementCodeType(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLObjectElement* castedThisObj = static_cast(thisObject); HTMLObjectElement* imp = static_cast(castedThisObj->impl()); imp->setAttribute(HTMLNames::codetypeAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLObjectElementData(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLObjectElement* castedThisObj = static_cast(thisObject); HTMLObjectElement* imp = static_cast(castedThisObj->impl()); imp->setAttribute(HTMLNames::dataAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLObjectElementDeclare(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLObjectElement* castedThisObj = static_cast(thisObject); HTMLObjectElement* imp = static_cast(castedThisObj->impl()); imp->setDeclare(value.toBoolean(exec)); } void setJSHTMLObjectElementHeight(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLObjectElement* castedThisObj = static_cast(thisObject); HTMLObjectElement* imp = static_cast(castedThisObj->impl()); imp->setAttribute(HTMLNames::heightAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLObjectElementHspace(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLObjectElement* castedThisObj = static_cast(thisObject); HTMLObjectElement* imp = static_cast(castedThisObj->impl()); imp->setHspace(value.toInt32(exec)); } void setJSHTMLObjectElementName(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLObjectElement* castedThisObj = static_cast(thisObject); HTMLObjectElement* imp = static_cast(castedThisObj->impl()); imp->setAttribute(HTMLNames::nameAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLObjectElementStandby(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLObjectElement* castedThisObj = static_cast(thisObject); HTMLObjectElement* imp = static_cast(castedThisObj->impl()); imp->setAttribute(HTMLNames::standbyAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLObjectElementType(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLObjectElement* castedThisObj = static_cast(thisObject); HTMLObjectElement* imp = static_cast(castedThisObj->impl()); imp->setAttribute(HTMLNames::typeAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLObjectElementUseMap(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLObjectElement* castedThisObj = static_cast(thisObject); HTMLObjectElement* imp = static_cast(castedThisObj->impl()); imp->setAttribute(HTMLNames::usemapAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLObjectElementVspace(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLObjectElement* castedThisObj = static_cast(thisObject); HTMLObjectElement* imp = static_cast(castedThisObj->impl()); imp->setVspace(value.toInt32(exec)); } void setJSHTMLObjectElementWidth(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLObjectElement* castedThisObj = static_cast(thisObject); HTMLObjectElement* imp = static_cast(castedThisObj->impl()); imp->setAttribute(HTMLNames::widthAttr, valueToStringWithNullCheck(exec, value)); } JSValue JSHTMLObjectElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor(exec, static_cast(globalObject)); } JSValue JSC_HOST_CALL jsHTMLObjectElementPrototypeFunctionGetSVGDocument(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) { UNUSED_PARAM(args); if (!thisValue.inherits(&JSHTMLObjectElement::s_info)) return throwError(exec, TypeError); JSHTMLObjectElement* castedThisObj = static_cast(asObject(thisValue)); HTMLObjectElement* imp = static_cast(castedThisObj->impl()); ExceptionCode ec = 0; if (!checkNodeSecurity(exec, imp->getSVGDocument(ec))) return jsUndefined(); JSC::JSValue result = toJS(exec, castedThisObj->globalObject(), WTF::getPtr(imp->getSVGDocument(ec))); setDOMException(exec, ec); return result; } }