| 1 | /* |
| 2 | This file is part of the WebKit open source project. |
| 3 | This file has been generated by generate-bindings.pl. DO NOT MODIFY! |
| 4 | |
| 5 | This library is free software; you can redistribute it and/or |
| 6 | modify it under the terms of the GNU Library General Public |
| 7 | License as published by the Free Software Foundation; either |
| 8 | version 2 of the License, or (at your option) any later version. |
| 9 | |
| 10 | This library is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | Library General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU Library General Public License |
| 16 | along with this library; see the file COPYING.LIB. If not, write to |
| 17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 | Boston, MA 02110-1301, USA. |
| 19 | */ |
| 20 | |
| 21 | #include "config.h" |
| 22 | #include "JSHTMLObjectElement.h" |
| 23 | |
| 24 | #include "CustomElementReactionQueue.h" |
| 25 | #include "HTMLNames.h" |
| 26 | #include "JSDOMAttribute.h" |
| 27 | #include "JSDOMBinding.h" |
| 28 | #include "JSDOMBindingSecurity.h" |
| 29 | #include "JSDOMConstructorNotConstructable.h" |
| 30 | #include "JSDOMConvertBoolean.h" |
| 31 | #include "JSDOMConvertInterface.h" |
| 32 | #include "JSDOMConvertNumbers.h" |
| 33 | #include "JSDOMConvertStrings.h" |
| 34 | #include "JSDOMExceptionHandling.h" |
| 35 | #include "JSDOMGlobalObject.h" |
| 36 | #include "JSDOMOperation.h" |
| 37 | #include "JSDOMWrapperCache.h" |
| 38 | #include "JSDocument.h" |
| 39 | #include "JSHTMLFormElement.h" |
| 40 | #include "JSPluginElementFunctions.h" |
| 41 | #include "JSValidityState.h" |
| 42 | #include "JSWindowProxy.h" |
| 43 | #include "RuntimeEnabledFeatures.h" |
| 44 | #include "ScriptExecutionContext.h" |
| 45 | #include <JavaScriptCore/HeapSnapshotBuilder.h> |
| 46 | #include <JavaScriptCore/JSCInlines.h> |
| 47 | #include <wtf/GetPtr.h> |
| 48 | #include <wtf/PointerPreparations.h> |
| 49 | #include <wtf/URL.h> |
| 50 | |
| 51 | |
| 52 | namespace WebCore { |
| 53 | using namespace JSC; |
| 54 | |
| 55 | // Functions |
| 56 | |
| 57 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLObjectElementPrototypeFunctionCheckValidity(JSC::ExecState*); |
| 58 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLObjectElementPrototypeFunctionReportValidity(JSC::ExecState*); |
| 59 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLObjectElementPrototypeFunctionSetCustomValidity(JSC::ExecState*); |
| 60 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLObjectElementPrototypeFunctionGetSVGDocument(JSC::ExecState*); |
| 61 | |
| 62 | // Attributes |
| 63 | |
| 64 | JSC::EncodedJSValue jsHTMLObjectElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 65 | bool setJSHTMLObjectElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 66 | JSC::EncodedJSValue jsHTMLObjectElementForm(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 67 | JSC::EncodedJSValue jsHTMLObjectElementCode(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 68 | bool setJSHTMLObjectElementCode(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 69 | JSC::EncodedJSValue jsHTMLObjectElementAlign(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 70 | bool setJSHTMLObjectElementAlign(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 71 | JSC::EncodedJSValue jsHTMLObjectElementArchive(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 72 | bool setJSHTMLObjectElementArchive(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 73 | JSC::EncodedJSValue jsHTMLObjectElementBorder(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 74 | bool setJSHTMLObjectElementBorder(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 75 | JSC::EncodedJSValue jsHTMLObjectElementCodeBase(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 76 | bool setJSHTMLObjectElementCodeBase(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 77 | JSC::EncodedJSValue jsHTMLObjectElementCodeType(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 78 | bool setJSHTMLObjectElementCodeType(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 79 | JSC::EncodedJSValue jsHTMLObjectElementData(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 80 | bool setJSHTMLObjectElementData(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 81 | JSC::EncodedJSValue jsHTMLObjectElementDeclare(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 82 | bool setJSHTMLObjectElementDeclare(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 83 | JSC::EncodedJSValue jsHTMLObjectElementHeight(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 84 | bool setJSHTMLObjectElementHeight(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 85 | JSC::EncodedJSValue jsHTMLObjectElementHspace(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 86 | bool setJSHTMLObjectElementHspace(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 87 | JSC::EncodedJSValue jsHTMLObjectElementName(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 88 | bool setJSHTMLObjectElementName(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 89 | JSC::EncodedJSValue jsHTMLObjectElementStandby(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 90 | bool setJSHTMLObjectElementStandby(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 91 | JSC::EncodedJSValue jsHTMLObjectElementType(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 92 | bool setJSHTMLObjectElementType(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 93 | JSC::EncodedJSValue jsHTMLObjectElementUseMap(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 94 | bool setJSHTMLObjectElementUseMap(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 95 | JSC::EncodedJSValue jsHTMLObjectElementVspace(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 96 | bool setJSHTMLObjectElementVspace(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 97 | JSC::EncodedJSValue jsHTMLObjectElementWidth(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 98 | bool setJSHTMLObjectElementWidth(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 99 | JSC::EncodedJSValue jsHTMLObjectElementWillValidate(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 100 | JSC::EncodedJSValue jsHTMLObjectElementValidity(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 101 | JSC::EncodedJSValue jsHTMLObjectElementValidationMessage(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 102 | JSC::EncodedJSValue jsHTMLObjectElementContentDocument(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 103 | JSC::EncodedJSValue jsHTMLObjectElementContentWindow(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 104 | |
| 105 | class JSHTMLObjectElementPrototype : public JSC::JSNonFinalObject { |
| 106 | public: |
| 107 | using Base = JSC::JSNonFinalObject; |
| 108 | static JSHTMLObjectElementPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
| 109 | { |
| 110 | JSHTMLObjectElementPrototype* ptr = new (NotNull, JSC::allocateCell<JSHTMLObjectElementPrototype>(vm.heap)) JSHTMLObjectElementPrototype(vm, globalObject, structure); |
| 111 | ptr->finishCreation(vm); |
| 112 | return ptr; |
| 113 | } |
| 114 | |
| 115 | DECLARE_INFO; |
| 116 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
| 117 | { |
| 118 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
| 119 | } |
| 120 | |
| 121 | private: |
| 122 | JSHTMLObjectElementPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
| 123 | : JSC::JSNonFinalObject(vm, structure) |
| 124 | { |
| 125 | } |
| 126 | |
| 127 | void finishCreation(JSC::VM&); |
| 128 | }; |
| 129 | |
| 130 | using JSHTMLObjectElementConstructor = JSDOMConstructorNotConstructable<JSHTMLObjectElement>; |
| 131 | |
| 132 | template<> JSValue JSHTMLObjectElementConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
| 133 | { |
| 134 | return JSHTMLElement::getConstructor(vm, &globalObject); |
| 135 | } |
| 136 | |
| 137 | template<> void JSHTMLObjectElementConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
| 138 | { |
| 139 | putDirect(vm, vm.propertyNames->prototype, JSHTMLObjectElement::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| 140 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("HTMLObjectElement"_s )), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| 141 | putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| 142 | } |
| 143 | |
| 144 | template<> const ClassInfo JSHTMLObjectElementConstructor::s_info = { "HTMLObjectElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSHTMLObjectElementConstructor) }; |
| 145 | |
| 146 | /* Hash table for prototype */ |
| 147 | |
| 148 | static const HashTableValue JSHTMLObjectElementPrototypeTableValues[] = |
| 149 | { |
| 150 | { "constructor" , static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLObjectElementConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLObjectElementConstructor) } }, |
| 151 | { "form" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLObjectElementForm), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| 152 | { "code" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLObjectElementCode), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLObjectElementCode) } }, |
| 153 | { "align" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLObjectElementAlign), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLObjectElementAlign) } }, |
| 154 | { "archive" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLObjectElementArchive), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLObjectElementArchive) } }, |
| 155 | { "border" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLObjectElementBorder), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLObjectElementBorder) } }, |
| 156 | { "codeBase" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLObjectElementCodeBase), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLObjectElementCodeBase) } }, |
| 157 | { "codeType" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLObjectElementCodeType), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLObjectElementCodeType) } }, |
| 158 | { "data" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLObjectElementData), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLObjectElementData) } }, |
| 159 | { "declare" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLObjectElementDeclare), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLObjectElementDeclare) } }, |
| 160 | { "height" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLObjectElementHeight), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLObjectElementHeight) } }, |
| 161 | { "hspace" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLObjectElementHspace), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLObjectElementHspace) } }, |
| 162 | { "name" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLObjectElementName), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLObjectElementName) } }, |
| 163 | { "standby" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLObjectElementStandby), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLObjectElementStandby) } }, |
| 164 | { "type" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLObjectElementType), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLObjectElementType) } }, |
| 165 | { "useMap" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLObjectElementUseMap), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLObjectElementUseMap) } }, |
| 166 | { "vspace" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLObjectElementVspace), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLObjectElementVspace) } }, |
| 167 | { "width" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLObjectElementWidth), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLObjectElementWidth) } }, |
| 168 | { "willValidate" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLObjectElementWillValidate), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| 169 | { "validity" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLObjectElementValidity), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| 170 | { "validationMessage" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLObjectElementValidationMessage), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| 171 | { "contentDocument" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLObjectElementContentDocument), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| 172 | { "contentWindow" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLObjectElementContentWindow), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| 173 | { "checkValidity" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLObjectElementPrototypeFunctionCheckValidity), (intptr_t) (0) } }, |
| 174 | { "reportValidity" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLObjectElementPrototypeFunctionReportValidity), (intptr_t) (0) } }, |
| 175 | { "setCustomValidity" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLObjectElementPrototypeFunctionSetCustomValidity), (intptr_t) (1) } }, |
| 176 | { "getSVGDocument" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLObjectElementPrototypeFunctionGetSVGDocument), (intptr_t) (0) } }, |
| 177 | }; |
| 178 | |
| 179 | const ClassInfo JSHTMLObjectElementPrototype::s_info = { "HTMLObjectElementPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSHTMLObjectElementPrototype) }; |
| 180 | |
| 181 | void JSHTMLObjectElementPrototype::finishCreation(VM& vm) |
| 182 | { |
| 183 | Base::finishCreation(vm); |
| 184 | reifyStaticProperties(vm, JSHTMLObjectElement::info(), JSHTMLObjectElementPrototypeTableValues, *this); |
| 185 | bool hasDisabledRuntimeProperties = false; |
| 186 | if (!RuntimeEnabledFeatures::sharedFeatures().interactiveFormValidationEnabled()) { |
| 187 | hasDisabledRuntimeProperties = true; |
| 188 | auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("reportValidity" ), strlen("reportValidity" )); |
| 189 | VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); |
| 190 | JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); |
| 191 | } |
| 192 | if (hasDisabledRuntimeProperties && structure()->isDictionary()) |
| 193 | flattenDictionaryObject(vm); |
| 194 | } |
| 195 | |
| 196 | const ClassInfo JSHTMLObjectElement::s_info = { "HTMLObjectElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSHTMLObjectElement) }; |
| 197 | |
| 198 | JSHTMLObjectElement::JSHTMLObjectElement(Structure* structure, JSDOMGlobalObject& globalObject, Ref<HTMLObjectElement>&& impl) |
| 199 | : JSHTMLElement(structure, globalObject, WTFMove(impl)) |
| 200 | { |
| 201 | } |
| 202 | |
| 203 | void JSHTMLObjectElement::finishCreation(VM& vm) |
| 204 | { |
| 205 | Base::finishCreation(vm); |
| 206 | ASSERT(inherits(vm, info())); |
| 207 | |
| 208 | } |
| 209 | |
| 210 | JSObject* JSHTMLObjectElement::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
| 211 | { |
| 212 | return JSHTMLObjectElementPrototype::create(vm, &globalObject, JSHTMLObjectElementPrototype::createStructure(vm, &globalObject, JSHTMLElement::prototype(vm, globalObject))); |
| 213 | } |
| 214 | |
| 215 | JSObject* JSHTMLObjectElement::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
| 216 | { |
| 217 | return getDOMPrototype<JSHTMLObjectElement>(vm, globalObject); |
| 218 | } |
| 219 | |
| 220 | JSValue JSHTMLObjectElement::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
| 221 | { |
| 222 | return getDOMConstructor<JSHTMLObjectElementConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
| 223 | } |
| 224 | |
| 225 | bool JSHTMLObjectElement::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot) |
| 226 | { |
| 227 | auto* thisObject = jsCast<JSHTMLObjectElement*>(object); |
| 228 | ASSERT_GC_OBJECT_INHERITS(thisObject, info()); |
| 229 | if (pluginElementCustomGetOwnPropertySlot(thisObject, state, propertyName, slot)) |
| 230 | return true; |
| 231 | return JSObject::getOwnPropertySlot(object, state, propertyName, slot); |
| 232 | } |
| 233 | |
| 234 | bool JSHTMLObjectElement::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, unsigned index, PropertySlot& slot) |
| 235 | { |
| 236 | auto* thisObject = jsCast<JSHTMLObjectElement*>(object); |
| 237 | ASSERT_GC_OBJECT_INHERITS(thisObject, info()); |
| 238 | auto propertyName = Identifier::from(state, index); |
| 239 | if (pluginElementCustomGetOwnPropertySlot(thisObject, state, propertyName, slot)) |
| 240 | return true; |
| 241 | return JSObject::getOwnPropertySlotByIndex(object, state, index, slot); |
| 242 | } |
| 243 | |
| 244 | bool JSHTMLObjectElement::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& putPropertySlot) |
| 245 | { |
| 246 | auto* thisObject = jsCast<JSHTMLObjectElement*>(cell); |
| 247 | ASSERT_GC_OBJECT_INHERITS(thisObject, info()); |
| 248 | |
| 249 | bool putResult = false; |
| 250 | if (pluginElementCustomPut(thisObject, state, propertyName, value, putPropertySlot, putResult)) |
| 251 | return putResult; |
| 252 | |
| 253 | return JSObject::put(thisObject, state, propertyName, value, putPropertySlot); |
| 254 | } |
| 255 | |
| 256 | bool JSHTMLObjectElement::putByIndex(JSCell* cell, ExecState* state, unsigned index, JSValue value, bool shouldThrow) |
| 257 | { |
| 258 | auto* thisObject = jsCast<JSHTMLObjectElement*>(cell); |
| 259 | ASSERT_GC_OBJECT_INHERITS(thisObject, info()); |
| 260 | |
| 261 | auto propertyName = Identifier::from(state, index); |
| 262 | PutPropertySlot putPropertySlot(thisObject, shouldThrow); |
| 263 | bool putResult = false; |
| 264 | if (pluginElementCustomPut(thisObject, state, propertyName, value, putPropertySlot, putResult)) |
| 265 | return putResult; |
| 266 | |
| 267 | return JSObject::putByIndex(cell, state, index, value, shouldThrow); |
| 268 | } |
| 269 | |
| 270 | CallType JSHTMLObjectElement::getCallData(JSCell* cell, CallData& callData) |
| 271 | { |
| 272 | auto* thisObject = jsCast<JSHTMLObjectElement*>(cell); |
| 273 | ASSERT_GC_OBJECT_INHERITS(thisObject, info()); |
| 274 | |
| 275 | return pluginElementCustomGetCallData(thisObject, callData); |
| 276 | } |
| 277 | |
| 278 | template<> inline JSHTMLObjectElement* IDLAttribute<JSHTMLObjectElement>::cast(ExecState& state, EncodedJSValue thisValue) |
| 279 | { |
| 280 | return jsDynamicCast<JSHTMLObjectElement*>(state.vm(), JSValue::decode(thisValue)); |
| 281 | } |
| 282 | |
| 283 | template<> inline JSHTMLObjectElement* IDLOperation<JSHTMLObjectElement>::cast(ExecState& state) |
| 284 | { |
| 285 | return jsDynamicCast<JSHTMLObjectElement*>(state.vm(), state.thisValue()); |
| 286 | } |
| 287 | |
| 288 | EncodedJSValue jsHTMLObjectElementConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 289 | { |
| 290 | VM& vm = state->vm(); |
| 291 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
| 292 | auto* prototype = jsDynamicCast<JSHTMLObjectElementPrototype*>(vm, JSValue::decode(thisValue)); |
| 293 | if (UNLIKELY(!prototype)) |
| 294 | return throwVMTypeError(state, throwScope); |
| 295 | return JSValue::encode(JSHTMLObjectElement::getConstructor(state->vm(), prototype->globalObject())); |
| 296 | } |
| 297 | |
| 298 | bool setJSHTMLObjectElementConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 299 | { |
| 300 | VM& vm = state->vm(); |
| 301 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
| 302 | auto* prototype = jsDynamicCast<JSHTMLObjectElementPrototype*>(vm, JSValue::decode(thisValue)); |
| 303 | if (UNLIKELY(!prototype)) { |
| 304 | throwVMTypeError(state, throwScope); |
| 305 | return false; |
| 306 | } |
| 307 | // Shadowing a built-in constructor |
| 308 | return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue)); |
| 309 | } |
| 310 | |
| 311 | static inline JSValue jsHTMLObjectElementFormGetter(ExecState& state, JSHTMLObjectElement& thisObject, ThrowScope& throwScope) |
| 312 | { |
| 313 | UNUSED_PARAM(throwScope); |
| 314 | UNUSED_PARAM(state); |
| 315 | auto& impl = thisObject.wrapped(); |
| 316 | JSValue result = toJS<IDLInterface<HTMLFormElement>>(state, *thisObject.globalObject(), throwScope, impl.form()); |
| 317 | return result; |
| 318 | } |
| 319 | |
| 320 | EncodedJSValue jsHTMLObjectElementForm(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 321 | { |
| 322 | return IDLAttribute<JSHTMLObjectElement>::get<jsHTMLObjectElementFormGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "form" ); |
| 323 | } |
| 324 | |
| 325 | static inline JSValue jsHTMLObjectElementCodeGetter(ExecState& state, JSHTMLObjectElement& thisObject, ThrowScope& throwScope) |
| 326 | { |
| 327 | UNUSED_PARAM(throwScope); |
| 328 | UNUSED_PARAM(state); |
| 329 | auto& impl = thisObject.wrapped(); |
| 330 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::codeAttr)); |
| 331 | return result; |
| 332 | } |
| 333 | |
| 334 | EncodedJSValue jsHTMLObjectElementCode(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 335 | { |
| 336 | return IDLAttribute<JSHTMLObjectElement>::get<jsHTMLObjectElementCodeGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "code" ); |
| 337 | } |
| 338 | |
| 339 | static inline bool setJSHTMLObjectElementCodeSetter(ExecState& state, JSHTMLObjectElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 340 | { |
| 341 | UNUSED_PARAM(throwScope); |
| 342 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
| 343 | auto& impl = thisObject.wrapped(); |
| 344 | auto nativeValue = convert<IDLDOMString>(state, value); |
| 345 | RETURN_IF_EXCEPTION(throwScope, false); |
| 346 | AttributeSetter::call(state, throwScope, [&] { |
| 347 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::codeAttr, WTFMove(nativeValue)); |
| 348 | }); |
| 349 | return true; |
| 350 | } |
| 351 | |
| 352 | bool setJSHTMLObjectElementCode(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 353 | { |
| 354 | return IDLAttribute<JSHTMLObjectElement>::set<setJSHTMLObjectElementCodeSetter>(*state, thisValue, encodedValue, "code" ); |
| 355 | } |
| 356 | |
| 357 | static inline JSValue jsHTMLObjectElementAlignGetter(ExecState& state, JSHTMLObjectElement& thisObject, ThrowScope& throwScope) |
| 358 | { |
| 359 | UNUSED_PARAM(throwScope); |
| 360 | UNUSED_PARAM(state); |
| 361 | auto& impl = thisObject.wrapped(); |
| 362 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::alignAttr)); |
| 363 | return result; |
| 364 | } |
| 365 | |
| 366 | EncodedJSValue jsHTMLObjectElementAlign(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 367 | { |
| 368 | return IDLAttribute<JSHTMLObjectElement>::get<jsHTMLObjectElementAlignGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "align" ); |
| 369 | } |
| 370 | |
| 371 | static inline bool setJSHTMLObjectElementAlignSetter(ExecState& state, JSHTMLObjectElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 372 | { |
| 373 | UNUSED_PARAM(throwScope); |
| 374 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
| 375 | auto& impl = thisObject.wrapped(); |
| 376 | auto nativeValue = convert<IDLDOMString>(state, value); |
| 377 | RETURN_IF_EXCEPTION(throwScope, false); |
| 378 | AttributeSetter::call(state, throwScope, [&] { |
| 379 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::alignAttr, WTFMove(nativeValue)); |
| 380 | }); |
| 381 | return true; |
| 382 | } |
| 383 | |
| 384 | bool setJSHTMLObjectElementAlign(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 385 | { |
| 386 | return IDLAttribute<JSHTMLObjectElement>::set<setJSHTMLObjectElementAlignSetter>(*state, thisValue, encodedValue, "align" ); |
| 387 | } |
| 388 | |
| 389 | static inline JSValue jsHTMLObjectElementArchiveGetter(ExecState& state, JSHTMLObjectElement& thisObject, ThrowScope& throwScope) |
| 390 | { |
| 391 | UNUSED_PARAM(throwScope); |
| 392 | UNUSED_PARAM(state); |
| 393 | auto& impl = thisObject.wrapped(); |
| 394 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::archiveAttr)); |
| 395 | return result; |
| 396 | } |
| 397 | |
| 398 | EncodedJSValue jsHTMLObjectElementArchive(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 399 | { |
| 400 | return IDLAttribute<JSHTMLObjectElement>::get<jsHTMLObjectElementArchiveGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "archive" ); |
| 401 | } |
| 402 | |
| 403 | static inline bool setJSHTMLObjectElementArchiveSetter(ExecState& state, JSHTMLObjectElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 404 | { |
| 405 | UNUSED_PARAM(throwScope); |
| 406 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
| 407 | auto& impl = thisObject.wrapped(); |
| 408 | auto nativeValue = convert<IDLDOMString>(state, value); |
| 409 | RETURN_IF_EXCEPTION(throwScope, false); |
| 410 | AttributeSetter::call(state, throwScope, [&] { |
| 411 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::archiveAttr, WTFMove(nativeValue)); |
| 412 | }); |
| 413 | return true; |
| 414 | } |
| 415 | |
| 416 | bool setJSHTMLObjectElementArchive(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 417 | { |
| 418 | return IDLAttribute<JSHTMLObjectElement>::set<setJSHTMLObjectElementArchiveSetter>(*state, thisValue, encodedValue, "archive" ); |
| 419 | } |
| 420 | |
| 421 | static inline JSValue jsHTMLObjectElementBorderGetter(ExecState& state, JSHTMLObjectElement& thisObject, ThrowScope& throwScope) |
| 422 | { |
| 423 | UNUSED_PARAM(throwScope); |
| 424 | UNUSED_PARAM(state); |
| 425 | auto& impl = thisObject.wrapped(); |
| 426 | JSValue result = toJS<IDLTreatNullAsEmptyAdaptor<IDLDOMString>>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::borderAttr)); |
| 427 | return result; |
| 428 | } |
| 429 | |
| 430 | EncodedJSValue jsHTMLObjectElementBorder(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 431 | { |
| 432 | return IDLAttribute<JSHTMLObjectElement>::get<jsHTMLObjectElementBorderGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "border" ); |
| 433 | } |
| 434 | |
| 435 | static inline bool setJSHTMLObjectElementBorderSetter(ExecState& state, JSHTMLObjectElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 436 | { |
| 437 | UNUSED_PARAM(throwScope); |
| 438 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
| 439 | auto& impl = thisObject.wrapped(); |
| 440 | auto nativeValue = convert<IDLTreatNullAsEmptyAdaptor<IDLDOMString>>(state, value); |
| 441 | RETURN_IF_EXCEPTION(throwScope, false); |
| 442 | AttributeSetter::call(state, throwScope, [&] { |
| 443 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::borderAttr, WTFMove(nativeValue)); |
| 444 | }); |
| 445 | return true; |
| 446 | } |
| 447 | |
| 448 | bool setJSHTMLObjectElementBorder(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 449 | { |
| 450 | return IDLAttribute<JSHTMLObjectElement>::set<setJSHTMLObjectElementBorderSetter>(*state, thisValue, encodedValue, "border" ); |
| 451 | } |
| 452 | |
| 453 | static inline JSValue jsHTMLObjectElementCodeBaseGetter(ExecState& state, JSHTMLObjectElement& thisObject, ThrowScope& throwScope) |
| 454 | { |
| 455 | UNUSED_PARAM(throwScope); |
| 456 | UNUSED_PARAM(state); |
| 457 | auto& impl = thisObject.wrapped(); |
| 458 | JSValue result = toJS<IDLUSVString>(state, throwScope, impl.getURLAttribute(WebCore::HTMLNames::codebaseAttr)); |
| 459 | return result; |
| 460 | } |
| 461 | |
| 462 | EncodedJSValue jsHTMLObjectElementCodeBase(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 463 | { |
| 464 | return IDLAttribute<JSHTMLObjectElement>::get<jsHTMLObjectElementCodeBaseGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "codeBase" ); |
| 465 | } |
| 466 | |
| 467 | static inline bool setJSHTMLObjectElementCodeBaseSetter(ExecState& state, JSHTMLObjectElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 468 | { |
| 469 | UNUSED_PARAM(throwScope); |
| 470 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
| 471 | auto& impl = thisObject.wrapped(); |
| 472 | auto nativeValue = convert<IDLUSVString>(state, value); |
| 473 | RETURN_IF_EXCEPTION(throwScope, false); |
| 474 | AttributeSetter::call(state, throwScope, [&] { |
| 475 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::codebaseAttr, WTFMove(nativeValue)); |
| 476 | }); |
| 477 | return true; |
| 478 | } |
| 479 | |
| 480 | bool setJSHTMLObjectElementCodeBase(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 481 | { |
| 482 | return IDLAttribute<JSHTMLObjectElement>::set<setJSHTMLObjectElementCodeBaseSetter>(*state, thisValue, encodedValue, "codeBase" ); |
| 483 | } |
| 484 | |
| 485 | static inline JSValue jsHTMLObjectElementCodeTypeGetter(ExecState& state, JSHTMLObjectElement& thisObject, ThrowScope& throwScope) |
| 486 | { |
| 487 | UNUSED_PARAM(throwScope); |
| 488 | UNUSED_PARAM(state); |
| 489 | auto& impl = thisObject.wrapped(); |
| 490 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::codetypeAttr)); |
| 491 | return result; |
| 492 | } |
| 493 | |
| 494 | EncodedJSValue jsHTMLObjectElementCodeType(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 495 | { |
| 496 | return IDLAttribute<JSHTMLObjectElement>::get<jsHTMLObjectElementCodeTypeGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "codeType" ); |
| 497 | } |
| 498 | |
| 499 | static inline bool setJSHTMLObjectElementCodeTypeSetter(ExecState& state, JSHTMLObjectElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 500 | { |
| 501 | UNUSED_PARAM(throwScope); |
| 502 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
| 503 | auto& impl = thisObject.wrapped(); |
| 504 | auto nativeValue = convert<IDLDOMString>(state, value); |
| 505 | RETURN_IF_EXCEPTION(throwScope, false); |
| 506 | AttributeSetter::call(state, throwScope, [&] { |
| 507 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::codetypeAttr, WTFMove(nativeValue)); |
| 508 | }); |
| 509 | return true; |
| 510 | } |
| 511 | |
| 512 | bool setJSHTMLObjectElementCodeType(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 513 | { |
| 514 | return IDLAttribute<JSHTMLObjectElement>::set<setJSHTMLObjectElementCodeTypeSetter>(*state, thisValue, encodedValue, "codeType" ); |
| 515 | } |
| 516 | |
| 517 | static inline JSValue jsHTMLObjectElementDataGetter(ExecState& state, JSHTMLObjectElement& thisObject, ThrowScope& throwScope) |
| 518 | { |
| 519 | UNUSED_PARAM(throwScope); |
| 520 | UNUSED_PARAM(state); |
| 521 | auto& impl = thisObject.wrapped(); |
| 522 | JSValue result = toJS<IDLUSVString>(state, throwScope, impl.getURLAttribute(WebCore::HTMLNames::dataAttr)); |
| 523 | return result; |
| 524 | } |
| 525 | |
| 526 | EncodedJSValue jsHTMLObjectElementData(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 527 | { |
| 528 | return IDLAttribute<JSHTMLObjectElement>::get<jsHTMLObjectElementDataGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "data" ); |
| 529 | } |
| 530 | |
| 531 | static inline bool setJSHTMLObjectElementDataSetter(ExecState& state, JSHTMLObjectElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 532 | { |
| 533 | UNUSED_PARAM(throwScope); |
| 534 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
| 535 | auto& impl = thisObject.wrapped(); |
| 536 | auto nativeValue = convert<IDLUSVString>(state, value); |
| 537 | RETURN_IF_EXCEPTION(throwScope, false); |
| 538 | AttributeSetter::call(state, throwScope, [&] { |
| 539 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::dataAttr, WTFMove(nativeValue)); |
| 540 | }); |
| 541 | return true; |
| 542 | } |
| 543 | |
| 544 | bool setJSHTMLObjectElementData(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 545 | { |
| 546 | return IDLAttribute<JSHTMLObjectElement>::set<setJSHTMLObjectElementDataSetter>(*state, thisValue, encodedValue, "data" ); |
| 547 | } |
| 548 | |
| 549 | static inline JSValue jsHTMLObjectElementDeclareGetter(ExecState& state, JSHTMLObjectElement& thisObject, ThrowScope& throwScope) |
| 550 | { |
| 551 | UNUSED_PARAM(throwScope); |
| 552 | UNUSED_PARAM(state); |
| 553 | auto& impl = thisObject.wrapped(); |
| 554 | JSValue result = toJS<IDLBoolean>(state, throwScope, impl.hasAttributeWithoutSynchronization(WebCore::HTMLNames::declareAttr)); |
| 555 | return result; |
| 556 | } |
| 557 | |
| 558 | EncodedJSValue jsHTMLObjectElementDeclare(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 559 | { |
| 560 | return IDLAttribute<JSHTMLObjectElement>::get<jsHTMLObjectElementDeclareGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "declare" ); |
| 561 | } |
| 562 | |
| 563 | static inline bool setJSHTMLObjectElementDeclareSetter(ExecState& state, JSHTMLObjectElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 564 | { |
| 565 | UNUSED_PARAM(throwScope); |
| 566 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
| 567 | auto& impl = thisObject.wrapped(); |
| 568 | auto nativeValue = convert<IDLBoolean>(state, value); |
| 569 | RETURN_IF_EXCEPTION(throwScope, false); |
| 570 | AttributeSetter::call(state, throwScope, [&] { |
| 571 | return impl.setBooleanAttribute(WebCore::HTMLNames::declareAttr, WTFMove(nativeValue)); |
| 572 | }); |
| 573 | return true; |
| 574 | } |
| 575 | |
| 576 | bool setJSHTMLObjectElementDeclare(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 577 | { |
| 578 | return IDLAttribute<JSHTMLObjectElement>::set<setJSHTMLObjectElementDeclareSetter>(*state, thisValue, encodedValue, "declare" ); |
| 579 | } |
| 580 | |
| 581 | static inline JSValue jsHTMLObjectElementHeightGetter(ExecState& state, JSHTMLObjectElement& thisObject, ThrowScope& throwScope) |
| 582 | { |
| 583 | UNUSED_PARAM(throwScope); |
| 584 | UNUSED_PARAM(state); |
| 585 | auto& impl = thisObject.wrapped(); |
| 586 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::heightAttr)); |
| 587 | return result; |
| 588 | } |
| 589 | |
| 590 | EncodedJSValue jsHTMLObjectElementHeight(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 591 | { |
| 592 | return IDLAttribute<JSHTMLObjectElement>::get<jsHTMLObjectElementHeightGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "height" ); |
| 593 | } |
| 594 | |
| 595 | static inline bool setJSHTMLObjectElementHeightSetter(ExecState& state, JSHTMLObjectElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 596 | { |
| 597 | UNUSED_PARAM(throwScope); |
| 598 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
| 599 | auto& impl = thisObject.wrapped(); |
| 600 | auto nativeValue = convert<IDLDOMString>(state, value); |
| 601 | RETURN_IF_EXCEPTION(throwScope, false); |
| 602 | AttributeSetter::call(state, throwScope, [&] { |
| 603 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::heightAttr, WTFMove(nativeValue)); |
| 604 | }); |
| 605 | return true; |
| 606 | } |
| 607 | |
| 608 | bool setJSHTMLObjectElementHeight(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 609 | { |
| 610 | return IDLAttribute<JSHTMLObjectElement>::set<setJSHTMLObjectElementHeightSetter>(*state, thisValue, encodedValue, "height" ); |
| 611 | } |
| 612 | |
| 613 | static inline JSValue jsHTMLObjectElementHspaceGetter(ExecState& state, JSHTMLObjectElement& thisObject, ThrowScope& throwScope) |
| 614 | { |
| 615 | UNUSED_PARAM(throwScope); |
| 616 | UNUSED_PARAM(state); |
| 617 | auto& impl = thisObject.wrapped(); |
| 618 | JSValue result = toJS<IDLUnsignedLong>(state, throwScope, std::max(0, impl.getIntegralAttribute(WebCore::HTMLNames::hspaceAttr))); |
| 619 | return result; |
| 620 | } |
| 621 | |
| 622 | EncodedJSValue jsHTMLObjectElementHspace(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 623 | { |
| 624 | return IDLAttribute<JSHTMLObjectElement>::get<jsHTMLObjectElementHspaceGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "hspace" ); |
| 625 | } |
| 626 | |
| 627 | static inline bool setJSHTMLObjectElementHspaceSetter(ExecState& state, JSHTMLObjectElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 628 | { |
| 629 | UNUSED_PARAM(throwScope); |
| 630 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
| 631 | auto& impl = thisObject.wrapped(); |
| 632 | auto nativeValue = convert<IDLUnsignedLong>(state, value); |
| 633 | RETURN_IF_EXCEPTION(throwScope, false); |
| 634 | AttributeSetter::call(state, throwScope, [&] { |
| 635 | return impl.setUnsignedIntegralAttribute(WebCore::HTMLNames::hspaceAttr, WTFMove(nativeValue)); |
| 636 | }); |
| 637 | return true; |
| 638 | } |
| 639 | |
| 640 | bool setJSHTMLObjectElementHspace(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 641 | { |
| 642 | return IDLAttribute<JSHTMLObjectElement>::set<setJSHTMLObjectElementHspaceSetter>(*state, thisValue, encodedValue, "hspace" ); |
| 643 | } |
| 644 | |
| 645 | static inline JSValue jsHTMLObjectElementNameGetter(ExecState& state, JSHTMLObjectElement& thisObject, ThrowScope& throwScope) |
| 646 | { |
| 647 | UNUSED_PARAM(throwScope); |
| 648 | UNUSED_PARAM(state); |
| 649 | auto& impl = thisObject.wrapped(); |
| 650 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.getNameAttribute()); |
| 651 | return result; |
| 652 | } |
| 653 | |
| 654 | EncodedJSValue jsHTMLObjectElementName(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 655 | { |
| 656 | return IDLAttribute<JSHTMLObjectElement>::get<jsHTMLObjectElementNameGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "name" ); |
| 657 | } |
| 658 | |
| 659 | static inline bool setJSHTMLObjectElementNameSetter(ExecState& state, JSHTMLObjectElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 660 | { |
| 661 | UNUSED_PARAM(throwScope); |
| 662 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
| 663 | auto& impl = thisObject.wrapped(); |
| 664 | auto nativeValue = convert<IDLDOMString>(state, value); |
| 665 | RETURN_IF_EXCEPTION(throwScope, false); |
| 666 | AttributeSetter::call(state, throwScope, [&] { |
| 667 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::nameAttr, WTFMove(nativeValue)); |
| 668 | }); |
| 669 | return true; |
| 670 | } |
| 671 | |
| 672 | bool setJSHTMLObjectElementName(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 673 | { |
| 674 | return IDLAttribute<JSHTMLObjectElement>::set<setJSHTMLObjectElementNameSetter>(*state, thisValue, encodedValue, "name" ); |
| 675 | } |
| 676 | |
| 677 | static inline JSValue jsHTMLObjectElementStandbyGetter(ExecState& state, JSHTMLObjectElement& thisObject, ThrowScope& throwScope) |
| 678 | { |
| 679 | UNUSED_PARAM(throwScope); |
| 680 | UNUSED_PARAM(state); |
| 681 | auto& impl = thisObject.wrapped(); |
| 682 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::standbyAttr)); |
| 683 | return result; |
| 684 | } |
| 685 | |
| 686 | EncodedJSValue jsHTMLObjectElementStandby(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 687 | { |
| 688 | return IDLAttribute<JSHTMLObjectElement>::get<jsHTMLObjectElementStandbyGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "standby" ); |
| 689 | } |
| 690 | |
| 691 | static inline bool setJSHTMLObjectElementStandbySetter(ExecState& state, JSHTMLObjectElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 692 | { |
| 693 | UNUSED_PARAM(throwScope); |
| 694 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
| 695 | auto& impl = thisObject.wrapped(); |
| 696 | auto nativeValue = convert<IDLDOMString>(state, value); |
| 697 | RETURN_IF_EXCEPTION(throwScope, false); |
| 698 | AttributeSetter::call(state, throwScope, [&] { |
| 699 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::standbyAttr, WTFMove(nativeValue)); |
| 700 | }); |
| 701 | return true; |
| 702 | } |
| 703 | |
| 704 | bool setJSHTMLObjectElementStandby(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 705 | { |
| 706 | return IDLAttribute<JSHTMLObjectElement>::set<setJSHTMLObjectElementStandbySetter>(*state, thisValue, encodedValue, "standby" ); |
| 707 | } |
| 708 | |
| 709 | static inline JSValue jsHTMLObjectElementTypeGetter(ExecState& state, JSHTMLObjectElement& thisObject, ThrowScope& throwScope) |
| 710 | { |
| 711 | UNUSED_PARAM(throwScope); |
| 712 | UNUSED_PARAM(state); |
| 713 | auto& impl = thisObject.wrapped(); |
| 714 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::typeAttr)); |
| 715 | return result; |
| 716 | } |
| 717 | |
| 718 | EncodedJSValue jsHTMLObjectElementType(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 719 | { |
| 720 | return IDLAttribute<JSHTMLObjectElement>::get<jsHTMLObjectElementTypeGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "type" ); |
| 721 | } |
| 722 | |
| 723 | static inline bool setJSHTMLObjectElementTypeSetter(ExecState& state, JSHTMLObjectElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 724 | { |
| 725 | UNUSED_PARAM(throwScope); |
| 726 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
| 727 | auto& impl = thisObject.wrapped(); |
| 728 | auto nativeValue = convert<IDLDOMString>(state, value); |
| 729 | RETURN_IF_EXCEPTION(throwScope, false); |
| 730 | AttributeSetter::call(state, throwScope, [&] { |
| 731 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::typeAttr, WTFMove(nativeValue)); |
| 732 | }); |
| 733 | return true; |
| 734 | } |
| 735 | |
| 736 | bool setJSHTMLObjectElementType(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 737 | { |
| 738 | return IDLAttribute<JSHTMLObjectElement>::set<setJSHTMLObjectElementTypeSetter>(*state, thisValue, encodedValue, "type" ); |
| 739 | } |
| 740 | |
| 741 | static inline JSValue jsHTMLObjectElementUseMapGetter(ExecState& state, JSHTMLObjectElement& thisObject, ThrowScope& throwScope) |
| 742 | { |
| 743 | UNUSED_PARAM(throwScope); |
| 744 | UNUSED_PARAM(state); |
| 745 | auto& impl = thisObject.wrapped(); |
| 746 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::usemapAttr)); |
| 747 | return result; |
| 748 | } |
| 749 | |
| 750 | EncodedJSValue jsHTMLObjectElementUseMap(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 751 | { |
| 752 | return IDLAttribute<JSHTMLObjectElement>::get<jsHTMLObjectElementUseMapGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "useMap" ); |
| 753 | } |
| 754 | |
| 755 | static inline bool setJSHTMLObjectElementUseMapSetter(ExecState& state, JSHTMLObjectElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 756 | { |
| 757 | UNUSED_PARAM(throwScope); |
| 758 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
| 759 | auto& impl = thisObject.wrapped(); |
| 760 | auto nativeValue = convert<IDLDOMString>(state, value); |
| 761 | RETURN_IF_EXCEPTION(throwScope, false); |
| 762 | AttributeSetter::call(state, throwScope, [&] { |
| 763 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::usemapAttr, WTFMove(nativeValue)); |
| 764 | }); |
| 765 | return true; |
| 766 | } |
| 767 | |
| 768 | bool setJSHTMLObjectElementUseMap(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 769 | { |
| 770 | return IDLAttribute<JSHTMLObjectElement>::set<setJSHTMLObjectElementUseMapSetter>(*state, thisValue, encodedValue, "useMap" ); |
| 771 | } |
| 772 | |
| 773 | static inline JSValue jsHTMLObjectElementVspaceGetter(ExecState& state, JSHTMLObjectElement& thisObject, ThrowScope& throwScope) |
| 774 | { |
| 775 | UNUSED_PARAM(throwScope); |
| 776 | UNUSED_PARAM(state); |
| 777 | auto& impl = thisObject.wrapped(); |
| 778 | JSValue result = toJS<IDLUnsignedLong>(state, throwScope, std::max(0, impl.getIntegralAttribute(WebCore::HTMLNames::vspaceAttr))); |
| 779 | return result; |
| 780 | } |
| 781 | |
| 782 | EncodedJSValue jsHTMLObjectElementVspace(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 783 | { |
| 784 | return IDLAttribute<JSHTMLObjectElement>::get<jsHTMLObjectElementVspaceGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "vspace" ); |
| 785 | } |
| 786 | |
| 787 | static inline bool setJSHTMLObjectElementVspaceSetter(ExecState& state, JSHTMLObjectElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 788 | { |
| 789 | UNUSED_PARAM(throwScope); |
| 790 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
| 791 | auto& impl = thisObject.wrapped(); |
| 792 | auto nativeValue = convert<IDLUnsignedLong>(state, value); |
| 793 | RETURN_IF_EXCEPTION(throwScope, false); |
| 794 | AttributeSetter::call(state, throwScope, [&] { |
| 795 | return impl.setUnsignedIntegralAttribute(WebCore::HTMLNames::vspaceAttr, WTFMove(nativeValue)); |
| 796 | }); |
| 797 | return true; |
| 798 | } |
| 799 | |
| 800 | bool setJSHTMLObjectElementVspace(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 801 | { |
| 802 | return IDLAttribute<JSHTMLObjectElement>::set<setJSHTMLObjectElementVspaceSetter>(*state, thisValue, encodedValue, "vspace" ); |
| 803 | } |
| 804 | |
| 805 | static inline JSValue jsHTMLObjectElementWidthGetter(ExecState& state, JSHTMLObjectElement& thisObject, ThrowScope& throwScope) |
| 806 | { |
| 807 | UNUSED_PARAM(throwScope); |
| 808 | UNUSED_PARAM(state); |
| 809 | auto& impl = thisObject.wrapped(); |
| 810 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::widthAttr)); |
| 811 | return result; |
| 812 | } |
| 813 | |
| 814 | EncodedJSValue jsHTMLObjectElementWidth(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 815 | { |
| 816 | return IDLAttribute<JSHTMLObjectElement>::get<jsHTMLObjectElementWidthGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "width" ); |
| 817 | } |
| 818 | |
| 819 | static inline bool setJSHTMLObjectElementWidthSetter(ExecState& state, JSHTMLObjectElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 820 | { |
| 821 | UNUSED_PARAM(throwScope); |
| 822 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
| 823 | auto& impl = thisObject.wrapped(); |
| 824 | auto nativeValue = convert<IDLDOMString>(state, value); |
| 825 | RETURN_IF_EXCEPTION(throwScope, false); |
| 826 | AttributeSetter::call(state, throwScope, [&] { |
| 827 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::widthAttr, WTFMove(nativeValue)); |
| 828 | }); |
| 829 | return true; |
| 830 | } |
| 831 | |
| 832 | bool setJSHTMLObjectElementWidth(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 833 | { |
| 834 | return IDLAttribute<JSHTMLObjectElement>::set<setJSHTMLObjectElementWidthSetter>(*state, thisValue, encodedValue, "width" ); |
| 835 | } |
| 836 | |
| 837 | static inline JSValue jsHTMLObjectElementWillValidateGetter(ExecState& state, JSHTMLObjectElement& thisObject, ThrowScope& throwScope) |
| 838 | { |
| 839 | UNUSED_PARAM(throwScope); |
| 840 | UNUSED_PARAM(state); |
| 841 | auto& impl = thisObject.wrapped(); |
| 842 | JSValue result = toJS<IDLBoolean>(state, throwScope, impl.willValidate()); |
| 843 | return result; |
| 844 | } |
| 845 | |
| 846 | EncodedJSValue jsHTMLObjectElementWillValidate(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 847 | { |
| 848 | return IDLAttribute<JSHTMLObjectElement>::get<jsHTMLObjectElementWillValidateGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "willValidate" ); |
| 849 | } |
| 850 | |
| 851 | static inline JSValue jsHTMLObjectElementValidityGetter(ExecState& state, JSHTMLObjectElement& thisObject, ThrowScope& throwScope) |
| 852 | { |
| 853 | UNUSED_PARAM(throwScope); |
| 854 | UNUSED_PARAM(state); |
| 855 | auto& impl = thisObject.wrapped(); |
| 856 | JSValue result = toJS<IDLInterface<ValidityState>>(state, *thisObject.globalObject(), throwScope, impl.validity()); |
| 857 | return result; |
| 858 | } |
| 859 | |
| 860 | EncodedJSValue jsHTMLObjectElementValidity(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 861 | { |
| 862 | return IDLAttribute<JSHTMLObjectElement>::get<jsHTMLObjectElementValidityGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "validity" ); |
| 863 | } |
| 864 | |
| 865 | static inline JSValue jsHTMLObjectElementValidationMessageGetter(ExecState& state, JSHTMLObjectElement& thisObject, ThrowScope& throwScope) |
| 866 | { |
| 867 | UNUSED_PARAM(throwScope); |
| 868 | UNUSED_PARAM(state); |
| 869 | auto& impl = thisObject.wrapped(); |
| 870 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.validationMessage()); |
| 871 | return result; |
| 872 | } |
| 873 | |
| 874 | EncodedJSValue jsHTMLObjectElementValidationMessage(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 875 | { |
| 876 | return IDLAttribute<JSHTMLObjectElement>::get<jsHTMLObjectElementValidationMessageGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "validationMessage" ); |
| 877 | } |
| 878 | |
| 879 | static inline JSValue jsHTMLObjectElementContentDocumentGetter(ExecState& state, JSHTMLObjectElement& thisObject, ThrowScope& throwScope) |
| 880 | { |
| 881 | UNUSED_PARAM(throwScope); |
| 882 | UNUSED_PARAM(state); |
| 883 | auto& impl = thisObject.wrapped(); |
| 884 | JSValue result = toJS<IDLInterface<Document>>(state, *thisObject.globalObject(), throwScope, BindingSecurity::checkSecurityForNode(state, impl.contentDocument())); |
| 885 | return result; |
| 886 | } |
| 887 | |
| 888 | EncodedJSValue jsHTMLObjectElementContentDocument(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 889 | { |
| 890 | return IDLAttribute<JSHTMLObjectElement>::get<jsHTMLObjectElementContentDocumentGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "contentDocument" ); |
| 891 | } |
| 892 | |
| 893 | static inline JSValue jsHTMLObjectElementContentWindowGetter(ExecState& state, JSHTMLObjectElement& thisObject, ThrowScope& throwScope) |
| 894 | { |
| 895 | UNUSED_PARAM(throwScope); |
| 896 | UNUSED_PARAM(state); |
| 897 | auto& impl = thisObject.wrapped(); |
| 898 | JSValue result = toJS<IDLInterface<WindowProxy>>(state, *thisObject.globalObject(), throwScope, impl.contentWindow()); |
| 899 | return result; |
| 900 | } |
| 901 | |
| 902 | EncodedJSValue jsHTMLObjectElementContentWindow(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 903 | { |
| 904 | return IDLAttribute<JSHTMLObjectElement>::get<jsHTMLObjectElementContentWindowGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "contentWindow" ); |
| 905 | } |
| 906 | |
| 907 | static inline JSC::EncodedJSValue jsHTMLObjectElementPrototypeFunctionCheckValidityBody(JSC::ExecState* state, typename IDLOperation<JSHTMLObjectElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 908 | { |
| 909 | UNUSED_PARAM(state); |
| 910 | UNUSED_PARAM(throwScope); |
| 911 | auto& impl = castedThis->wrapped(); |
| 912 | return JSValue::encode(toJS<IDLBoolean>(impl.checkValidity())); |
| 913 | } |
| 914 | |
| 915 | EncodedJSValue JSC_HOST_CALL jsHTMLObjectElementPrototypeFunctionCheckValidity(ExecState* state) |
| 916 | { |
| 917 | return IDLOperation<JSHTMLObjectElement>::call<jsHTMLObjectElementPrototypeFunctionCheckValidityBody>(*state, "checkValidity" ); |
| 918 | } |
| 919 | |
| 920 | static inline JSC::EncodedJSValue jsHTMLObjectElementPrototypeFunctionReportValidityBody(JSC::ExecState* state, typename IDLOperation<JSHTMLObjectElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 921 | { |
| 922 | UNUSED_PARAM(state); |
| 923 | UNUSED_PARAM(throwScope); |
| 924 | auto& impl = castedThis->wrapped(); |
| 925 | return JSValue::encode(toJS<IDLBoolean>(impl.reportValidity())); |
| 926 | } |
| 927 | |
| 928 | EncodedJSValue JSC_HOST_CALL jsHTMLObjectElementPrototypeFunctionReportValidity(ExecState* state) |
| 929 | { |
| 930 | return IDLOperation<JSHTMLObjectElement>::call<jsHTMLObjectElementPrototypeFunctionReportValidityBody>(*state, "reportValidity" ); |
| 931 | } |
| 932 | |
| 933 | static inline JSC::EncodedJSValue jsHTMLObjectElementPrototypeFunctionSetCustomValidityBody(JSC::ExecState* state, typename IDLOperation<JSHTMLObjectElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 934 | { |
| 935 | UNUSED_PARAM(state); |
| 936 | UNUSED_PARAM(throwScope); |
| 937 | auto& impl = castedThis->wrapped(); |
| 938 | if (UNLIKELY(state->argumentCount() < 1)) |
| 939 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| 940 | auto error = convert<IDLDOMString>(*state, state->uncheckedArgument(0)); |
| 941 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 942 | impl.setCustomValidity(WTFMove(error)); |
| 943 | return JSValue::encode(jsUndefined()); |
| 944 | } |
| 945 | |
| 946 | EncodedJSValue JSC_HOST_CALL jsHTMLObjectElementPrototypeFunctionSetCustomValidity(ExecState* state) |
| 947 | { |
| 948 | return IDLOperation<JSHTMLObjectElement>::call<jsHTMLObjectElementPrototypeFunctionSetCustomValidityBody>(*state, "setCustomValidity" ); |
| 949 | } |
| 950 | |
| 951 | static inline JSC::EncodedJSValue jsHTMLObjectElementPrototypeFunctionGetSVGDocumentBody(JSC::ExecState* state, typename IDLOperation<JSHTMLObjectElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 952 | { |
| 953 | UNUSED_PARAM(state); |
| 954 | UNUSED_PARAM(throwScope); |
| 955 | auto& impl = castedThis->wrapped(); |
| 956 | return JSValue::encode(toJS<IDLInterface<Document>>(*state, *castedThis->globalObject(), throwScope, BindingSecurity::checkSecurityForNode(*state, impl.getSVGDocument()))); |
| 957 | } |
| 958 | |
| 959 | EncodedJSValue JSC_HOST_CALL jsHTMLObjectElementPrototypeFunctionGetSVGDocument(ExecState* state) |
| 960 | { |
| 961 | return IDLOperation<JSHTMLObjectElement>::call<jsHTMLObjectElementPrototypeFunctionGetSVGDocumentBody>(*state, "getSVGDocument" ); |
| 962 | } |
| 963 | |
| 964 | void JSHTMLObjectElement::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
| 965 | { |
| 966 | auto* thisObject = jsCast<JSHTMLObjectElement*>(cell); |
| 967 | builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
| 968 | if (thisObject->scriptExecutionContext()) |
| 969 | builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
| 970 | Base::heapSnapshot(cell, builder); |
| 971 | } |
| 972 | |
| 973 | |
| 974 | } |
| 975 | |