| 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 "JSHTMLKeygenElement.h" |
| 23 | |
| 24 | #include "HTMLNames.h" |
| 25 | #include "JSDOMAttribute.h" |
| 26 | #include "JSDOMBinding.h" |
| 27 | #include "JSDOMConstructorNotConstructable.h" |
| 28 | #include "JSDOMConvertBoolean.h" |
| 29 | #include "JSDOMConvertInterface.h" |
| 30 | #include "JSDOMConvertStrings.h" |
| 31 | #include "JSDOMExceptionHandling.h" |
| 32 | #include "JSDOMGlobalObject.h" |
| 33 | #include "JSDOMOperation.h" |
| 34 | #include "JSDOMWrapperCache.h" |
| 35 | #include "JSHTMLFormElement.h" |
| 36 | #include "JSNodeList.h" |
| 37 | #include "JSValidityState.h" |
| 38 | #include "RuntimeEnabledFeatures.h" |
| 39 | #include "ScriptExecutionContext.h" |
| 40 | #include <JavaScriptCore/HeapSnapshotBuilder.h> |
| 41 | #include <JavaScriptCore/JSCInlines.h> |
| 42 | #include <wtf/GetPtr.h> |
| 43 | #include <wtf/PointerPreparations.h> |
| 44 | #include <wtf/URL.h> |
| 45 | |
| 46 | |
| 47 | namespace WebCore { |
| 48 | using namespace JSC; |
| 49 | |
| 50 | // Functions |
| 51 | |
| 52 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLKeygenElementPrototypeFunctionCheckValidity(JSC::ExecState*); |
| 53 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLKeygenElementPrototypeFunctionReportValidity(JSC::ExecState*); |
| 54 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLKeygenElementPrototypeFunctionSetCustomValidity(JSC::ExecState*); |
| 55 | |
| 56 | // Attributes |
| 57 | |
| 58 | JSC::EncodedJSValue jsHTMLKeygenElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 59 | bool setJSHTMLKeygenElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 60 | JSC::EncodedJSValue jsHTMLKeygenElementAutofocus(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 61 | bool setJSHTMLKeygenElementAutofocus(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 62 | JSC::EncodedJSValue jsHTMLKeygenElementChallenge(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 63 | bool setJSHTMLKeygenElementChallenge(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 64 | JSC::EncodedJSValue jsHTMLKeygenElementDisabled(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 65 | bool setJSHTMLKeygenElementDisabled(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 66 | JSC::EncodedJSValue jsHTMLKeygenElementForm(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 67 | JSC::EncodedJSValue jsHTMLKeygenElementKeytype(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 68 | bool setJSHTMLKeygenElementKeytype(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 69 | JSC::EncodedJSValue jsHTMLKeygenElementName(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 70 | bool setJSHTMLKeygenElementName(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 71 | JSC::EncodedJSValue jsHTMLKeygenElementType(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 72 | JSC::EncodedJSValue jsHTMLKeygenElementWillValidate(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 73 | JSC::EncodedJSValue jsHTMLKeygenElementValidity(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 74 | JSC::EncodedJSValue jsHTMLKeygenElementValidationMessage(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 75 | JSC::EncodedJSValue jsHTMLKeygenElementLabels(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 76 | |
| 77 | class JSHTMLKeygenElementPrototype : public JSC::JSNonFinalObject { |
| 78 | public: |
| 79 | using Base = JSC::JSNonFinalObject; |
| 80 | static JSHTMLKeygenElementPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
| 81 | { |
| 82 | JSHTMLKeygenElementPrototype* ptr = new (NotNull, JSC::allocateCell<JSHTMLKeygenElementPrototype>(vm.heap)) JSHTMLKeygenElementPrototype(vm, globalObject, structure); |
| 83 | ptr->finishCreation(vm); |
| 84 | return ptr; |
| 85 | } |
| 86 | |
| 87 | DECLARE_INFO; |
| 88 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
| 89 | { |
| 90 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
| 91 | } |
| 92 | |
| 93 | private: |
| 94 | JSHTMLKeygenElementPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
| 95 | : JSC::JSNonFinalObject(vm, structure) |
| 96 | { |
| 97 | } |
| 98 | |
| 99 | void finishCreation(JSC::VM&); |
| 100 | }; |
| 101 | |
| 102 | using JSHTMLKeygenElementConstructor = JSDOMConstructorNotConstructable<JSHTMLKeygenElement>; |
| 103 | |
| 104 | template<> JSValue JSHTMLKeygenElementConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
| 105 | { |
| 106 | return JSHTMLElement::getConstructor(vm, &globalObject); |
| 107 | } |
| 108 | |
| 109 | template<> void JSHTMLKeygenElementConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
| 110 | { |
| 111 | putDirect(vm, vm.propertyNames->prototype, JSHTMLKeygenElement::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| 112 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("HTMLKeygenElement"_s )), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| 113 | putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| 114 | } |
| 115 | |
| 116 | template<> const ClassInfo JSHTMLKeygenElementConstructor::s_info = { "HTMLKeygenElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSHTMLKeygenElementConstructor) }; |
| 117 | |
| 118 | /* Hash table for prototype */ |
| 119 | |
| 120 | static const HashTableValue JSHTMLKeygenElementPrototypeTableValues[] = |
| 121 | { |
| 122 | { "constructor" , static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLKeygenElementConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLKeygenElementConstructor) } }, |
| 123 | { "autofocus" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLKeygenElementAutofocus), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLKeygenElementAutofocus) } }, |
| 124 | { "challenge" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLKeygenElementChallenge), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLKeygenElementChallenge) } }, |
| 125 | { "disabled" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLKeygenElementDisabled), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLKeygenElementDisabled) } }, |
| 126 | { "form" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLKeygenElementForm), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| 127 | { "keytype" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLKeygenElementKeytype), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLKeygenElementKeytype) } }, |
| 128 | { "name" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLKeygenElementName), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLKeygenElementName) } }, |
| 129 | { "type" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLKeygenElementType), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| 130 | { "willValidate" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLKeygenElementWillValidate), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| 131 | { "validity" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLKeygenElementValidity), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| 132 | { "validationMessage" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLKeygenElementValidationMessage), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| 133 | { "labels" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLKeygenElementLabels), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| 134 | { "checkValidity" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLKeygenElementPrototypeFunctionCheckValidity), (intptr_t) (0) } }, |
| 135 | { "reportValidity" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLKeygenElementPrototypeFunctionReportValidity), (intptr_t) (0) } }, |
| 136 | { "setCustomValidity" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLKeygenElementPrototypeFunctionSetCustomValidity), (intptr_t) (1) } }, |
| 137 | }; |
| 138 | |
| 139 | const ClassInfo JSHTMLKeygenElementPrototype::s_info = { "HTMLKeygenElementPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSHTMLKeygenElementPrototype) }; |
| 140 | |
| 141 | void JSHTMLKeygenElementPrototype::finishCreation(VM& vm) |
| 142 | { |
| 143 | Base::finishCreation(vm); |
| 144 | reifyStaticProperties(vm, JSHTMLKeygenElement::info(), JSHTMLKeygenElementPrototypeTableValues, *this); |
| 145 | bool hasDisabledRuntimeProperties = false; |
| 146 | if (!RuntimeEnabledFeatures::sharedFeatures().interactiveFormValidationEnabled()) { |
| 147 | hasDisabledRuntimeProperties = true; |
| 148 | auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("reportValidity" ), strlen("reportValidity" )); |
| 149 | VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); |
| 150 | JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); |
| 151 | } |
| 152 | if (hasDisabledRuntimeProperties && structure()->isDictionary()) |
| 153 | flattenDictionaryObject(vm); |
| 154 | } |
| 155 | |
| 156 | const ClassInfo JSHTMLKeygenElement::s_info = { "HTMLKeygenElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSHTMLKeygenElement) }; |
| 157 | |
| 158 | JSHTMLKeygenElement::JSHTMLKeygenElement(Structure* structure, JSDOMGlobalObject& globalObject, Ref<HTMLKeygenElement>&& impl) |
| 159 | : JSHTMLElement(structure, globalObject, WTFMove(impl)) |
| 160 | { |
| 161 | } |
| 162 | |
| 163 | void JSHTMLKeygenElement::finishCreation(VM& vm) |
| 164 | { |
| 165 | Base::finishCreation(vm); |
| 166 | ASSERT(inherits(vm, info())); |
| 167 | |
| 168 | } |
| 169 | |
| 170 | JSObject* JSHTMLKeygenElement::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
| 171 | { |
| 172 | return JSHTMLKeygenElementPrototype::create(vm, &globalObject, JSHTMLKeygenElementPrototype::createStructure(vm, &globalObject, JSHTMLElement::prototype(vm, globalObject))); |
| 173 | } |
| 174 | |
| 175 | JSObject* JSHTMLKeygenElement::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
| 176 | { |
| 177 | return getDOMPrototype<JSHTMLKeygenElement>(vm, globalObject); |
| 178 | } |
| 179 | |
| 180 | JSValue JSHTMLKeygenElement::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
| 181 | { |
| 182 | return getDOMConstructor<JSHTMLKeygenElementConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
| 183 | } |
| 184 | |
| 185 | template<> inline JSHTMLKeygenElement* IDLAttribute<JSHTMLKeygenElement>::cast(ExecState& state, EncodedJSValue thisValue) |
| 186 | { |
| 187 | return jsDynamicCast<JSHTMLKeygenElement*>(state.vm(), JSValue::decode(thisValue)); |
| 188 | } |
| 189 | |
| 190 | template<> inline JSHTMLKeygenElement* IDLOperation<JSHTMLKeygenElement>::cast(ExecState& state) |
| 191 | { |
| 192 | return jsDynamicCast<JSHTMLKeygenElement*>(state.vm(), state.thisValue()); |
| 193 | } |
| 194 | |
| 195 | EncodedJSValue jsHTMLKeygenElementConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 196 | { |
| 197 | VM& vm = state->vm(); |
| 198 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
| 199 | auto* prototype = jsDynamicCast<JSHTMLKeygenElementPrototype*>(vm, JSValue::decode(thisValue)); |
| 200 | if (UNLIKELY(!prototype)) |
| 201 | return throwVMTypeError(state, throwScope); |
| 202 | return JSValue::encode(JSHTMLKeygenElement::getConstructor(state->vm(), prototype->globalObject())); |
| 203 | } |
| 204 | |
| 205 | bool setJSHTMLKeygenElementConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 206 | { |
| 207 | VM& vm = state->vm(); |
| 208 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
| 209 | auto* prototype = jsDynamicCast<JSHTMLKeygenElementPrototype*>(vm, JSValue::decode(thisValue)); |
| 210 | if (UNLIKELY(!prototype)) { |
| 211 | throwVMTypeError(state, throwScope); |
| 212 | return false; |
| 213 | } |
| 214 | // Shadowing a built-in constructor |
| 215 | return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue)); |
| 216 | } |
| 217 | |
| 218 | static inline JSValue jsHTMLKeygenElementAutofocusGetter(ExecState& state, JSHTMLKeygenElement& thisObject, ThrowScope& throwScope) |
| 219 | { |
| 220 | UNUSED_PARAM(throwScope); |
| 221 | UNUSED_PARAM(state); |
| 222 | auto& impl = thisObject.wrapped(); |
| 223 | JSValue result = toJS<IDLBoolean>(state, throwScope, impl.hasAttributeWithoutSynchronization(WebCore::HTMLNames::autofocusAttr)); |
| 224 | return result; |
| 225 | } |
| 226 | |
| 227 | EncodedJSValue jsHTMLKeygenElementAutofocus(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 228 | { |
| 229 | return IDLAttribute<JSHTMLKeygenElement>::get<jsHTMLKeygenElementAutofocusGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "autofocus" ); |
| 230 | } |
| 231 | |
| 232 | static inline bool setJSHTMLKeygenElementAutofocusSetter(ExecState& state, JSHTMLKeygenElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 233 | { |
| 234 | UNUSED_PARAM(throwScope); |
| 235 | auto& impl = thisObject.wrapped(); |
| 236 | auto nativeValue = convert<IDLBoolean>(state, value); |
| 237 | RETURN_IF_EXCEPTION(throwScope, false); |
| 238 | AttributeSetter::call(state, throwScope, [&] { |
| 239 | return impl.setBooleanAttribute(WebCore::HTMLNames::autofocusAttr, WTFMove(nativeValue)); |
| 240 | }); |
| 241 | return true; |
| 242 | } |
| 243 | |
| 244 | bool setJSHTMLKeygenElementAutofocus(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 245 | { |
| 246 | return IDLAttribute<JSHTMLKeygenElement>::set<setJSHTMLKeygenElementAutofocusSetter>(*state, thisValue, encodedValue, "autofocus" ); |
| 247 | } |
| 248 | |
| 249 | static inline JSValue jsHTMLKeygenElementChallengeGetter(ExecState& state, JSHTMLKeygenElement& thisObject, ThrowScope& throwScope) |
| 250 | { |
| 251 | UNUSED_PARAM(throwScope); |
| 252 | UNUSED_PARAM(state); |
| 253 | auto& impl = thisObject.wrapped(); |
| 254 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::challengeAttr)); |
| 255 | return result; |
| 256 | } |
| 257 | |
| 258 | EncodedJSValue jsHTMLKeygenElementChallenge(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 259 | { |
| 260 | return IDLAttribute<JSHTMLKeygenElement>::get<jsHTMLKeygenElementChallengeGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "challenge" ); |
| 261 | } |
| 262 | |
| 263 | static inline bool setJSHTMLKeygenElementChallengeSetter(ExecState& state, JSHTMLKeygenElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 264 | { |
| 265 | UNUSED_PARAM(throwScope); |
| 266 | auto& impl = thisObject.wrapped(); |
| 267 | auto nativeValue = convert<IDLDOMString>(state, value); |
| 268 | RETURN_IF_EXCEPTION(throwScope, false); |
| 269 | AttributeSetter::call(state, throwScope, [&] { |
| 270 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::challengeAttr, WTFMove(nativeValue)); |
| 271 | }); |
| 272 | return true; |
| 273 | } |
| 274 | |
| 275 | bool setJSHTMLKeygenElementChallenge(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 276 | { |
| 277 | return IDLAttribute<JSHTMLKeygenElement>::set<setJSHTMLKeygenElementChallengeSetter>(*state, thisValue, encodedValue, "challenge" ); |
| 278 | } |
| 279 | |
| 280 | static inline JSValue jsHTMLKeygenElementDisabledGetter(ExecState& state, JSHTMLKeygenElement& thisObject, ThrowScope& throwScope) |
| 281 | { |
| 282 | UNUSED_PARAM(throwScope); |
| 283 | UNUSED_PARAM(state); |
| 284 | auto& impl = thisObject.wrapped(); |
| 285 | JSValue result = toJS<IDLBoolean>(state, throwScope, impl.hasAttributeWithoutSynchronization(WebCore::HTMLNames::disabledAttr)); |
| 286 | return result; |
| 287 | } |
| 288 | |
| 289 | EncodedJSValue jsHTMLKeygenElementDisabled(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 290 | { |
| 291 | return IDLAttribute<JSHTMLKeygenElement>::get<jsHTMLKeygenElementDisabledGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "disabled" ); |
| 292 | } |
| 293 | |
| 294 | static inline bool setJSHTMLKeygenElementDisabledSetter(ExecState& state, JSHTMLKeygenElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 295 | { |
| 296 | UNUSED_PARAM(throwScope); |
| 297 | auto& impl = thisObject.wrapped(); |
| 298 | auto nativeValue = convert<IDLBoolean>(state, value); |
| 299 | RETURN_IF_EXCEPTION(throwScope, false); |
| 300 | AttributeSetter::call(state, throwScope, [&] { |
| 301 | return impl.setBooleanAttribute(WebCore::HTMLNames::disabledAttr, WTFMove(nativeValue)); |
| 302 | }); |
| 303 | return true; |
| 304 | } |
| 305 | |
| 306 | bool setJSHTMLKeygenElementDisabled(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 307 | { |
| 308 | return IDLAttribute<JSHTMLKeygenElement>::set<setJSHTMLKeygenElementDisabledSetter>(*state, thisValue, encodedValue, "disabled" ); |
| 309 | } |
| 310 | |
| 311 | static inline JSValue jsHTMLKeygenElementFormGetter(ExecState& state, JSHTMLKeygenElement& 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 jsHTMLKeygenElementForm(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 321 | { |
| 322 | return IDLAttribute<JSHTMLKeygenElement>::get<jsHTMLKeygenElementFormGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "form" ); |
| 323 | } |
| 324 | |
| 325 | static inline JSValue jsHTMLKeygenElementKeytypeGetter(ExecState& state, JSHTMLKeygenElement& 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.keytype()); |
| 331 | return result; |
| 332 | } |
| 333 | |
| 334 | EncodedJSValue jsHTMLKeygenElementKeytype(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 335 | { |
| 336 | return IDLAttribute<JSHTMLKeygenElement>::get<jsHTMLKeygenElementKeytypeGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "keytype" ); |
| 337 | } |
| 338 | |
| 339 | static inline bool setJSHTMLKeygenElementKeytypeSetter(ExecState& state, JSHTMLKeygenElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 340 | { |
| 341 | UNUSED_PARAM(throwScope); |
| 342 | auto& impl = thisObject.wrapped(); |
| 343 | auto nativeValue = convert<IDLDOMString>(state, value); |
| 344 | RETURN_IF_EXCEPTION(throwScope, false); |
| 345 | AttributeSetter::call(state, throwScope, [&] { |
| 346 | return impl.setKeytype(WTFMove(nativeValue)); |
| 347 | }); |
| 348 | return true; |
| 349 | } |
| 350 | |
| 351 | bool setJSHTMLKeygenElementKeytype(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 352 | { |
| 353 | return IDLAttribute<JSHTMLKeygenElement>::set<setJSHTMLKeygenElementKeytypeSetter>(*state, thisValue, encodedValue, "keytype" ); |
| 354 | } |
| 355 | |
| 356 | static inline JSValue jsHTMLKeygenElementNameGetter(ExecState& state, JSHTMLKeygenElement& thisObject, ThrowScope& throwScope) |
| 357 | { |
| 358 | UNUSED_PARAM(throwScope); |
| 359 | UNUSED_PARAM(state); |
| 360 | auto& impl = thisObject.wrapped(); |
| 361 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.getNameAttribute()); |
| 362 | return result; |
| 363 | } |
| 364 | |
| 365 | EncodedJSValue jsHTMLKeygenElementName(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 366 | { |
| 367 | return IDLAttribute<JSHTMLKeygenElement>::get<jsHTMLKeygenElementNameGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "name" ); |
| 368 | } |
| 369 | |
| 370 | static inline bool setJSHTMLKeygenElementNameSetter(ExecState& state, JSHTMLKeygenElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 371 | { |
| 372 | UNUSED_PARAM(throwScope); |
| 373 | auto& impl = thisObject.wrapped(); |
| 374 | auto nativeValue = convert<IDLDOMString>(state, value); |
| 375 | RETURN_IF_EXCEPTION(throwScope, false); |
| 376 | AttributeSetter::call(state, throwScope, [&] { |
| 377 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::nameAttr, WTFMove(nativeValue)); |
| 378 | }); |
| 379 | return true; |
| 380 | } |
| 381 | |
| 382 | bool setJSHTMLKeygenElementName(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 383 | { |
| 384 | return IDLAttribute<JSHTMLKeygenElement>::set<setJSHTMLKeygenElementNameSetter>(*state, thisValue, encodedValue, "name" ); |
| 385 | } |
| 386 | |
| 387 | static inline JSValue jsHTMLKeygenElementTypeGetter(ExecState& state, JSHTMLKeygenElement& thisObject, ThrowScope& throwScope) |
| 388 | { |
| 389 | UNUSED_PARAM(throwScope); |
| 390 | UNUSED_PARAM(state); |
| 391 | auto& impl = thisObject.wrapped(); |
| 392 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.type()); |
| 393 | return result; |
| 394 | } |
| 395 | |
| 396 | EncodedJSValue jsHTMLKeygenElementType(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 397 | { |
| 398 | return IDLAttribute<JSHTMLKeygenElement>::get<jsHTMLKeygenElementTypeGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "type" ); |
| 399 | } |
| 400 | |
| 401 | static inline JSValue jsHTMLKeygenElementWillValidateGetter(ExecState& state, JSHTMLKeygenElement& thisObject, ThrowScope& throwScope) |
| 402 | { |
| 403 | UNUSED_PARAM(throwScope); |
| 404 | UNUSED_PARAM(state); |
| 405 | auto& impl = thisObject.wrapped(); |
| 406 | JSValue result = toJS<IDLBoolean>(state, throwScope, impl.willValidate()); |
| 407 | return result; |
| 408 | } |
| 409 | |
| 410 | EncodedJSValue jsHTMLKeygenElementWillValidate(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 411 | { |
| 412 | return IDLAttribute<JSHTMLKeygenElement>::get<jsHTMLKeygenElementWillValidateGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "willValidate" ); |
| 413 | } |
| 414 | |
| 415 | static inline JSValue jsHTMLKeygenElementValidityGetter(ExecState& state, JSHTMLKeygenElement& thisObject, ThrowScope& throwScope) |
| 416 | { |
| 417 | UNUSED_PARAM(throwScope); |
| 418 | UNUSED_PARAM(state); |
| 419 | auto& impl = thisObject.wrapped(); |
| 420 | JSValue result = toJS<IDLInterface<ValidityState>>(state, *thisObject.globalObject(), throwScope, impl.validity()); |
| 421 | return result; |
| 422 | } |
| 423 | |
| 424 | EncodedJSValue jsHTMLKeygenElementValidity(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 425 | { |
| 426 | return IDLAttribute<JSHTMLKeygenElement>::get<jsHTMLKeygenElementValidityGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "validity" ); |
| 427 | } |
| 428 | |
| 429 | static inline JSValue jsHTMLKeygenElementValidationMessageGetter(ExecState& state, JSHTMLKeygenElement& thisObject, ThrowScope& throwScope) |
| 430 | { |
| 431 | UNUSED_PARAM(throwScope); |
| 432 | UNUSED_PARAM(state); |
| 433 | auto& impl = thisObject.wrapped(); |
| 434 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.validationMessage()); |
| 435 | return result; |
| 436 | } |
| 437 | |
| 438 | EncodedJSValue jsHTMLKeygenElementValidationMessage(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 439 | { |
| 440 | return IDLAttribute<JSHTMLKeygenElement>::get<jsHTMLKeygenElementValidationMessageGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "validationMessage" ); |
| 441 | } |
| 442 | |
| 443 | static inline JSValue jsHTMLKeygenElementLabelsGetter(ExecState& state, JSHTMLKeygenElement& thisObject, ThrowScope& throwScope) |
| 444 | { |
| 445 | UNUSED_PARAM(throwScope); |
| 446 | UNUSED_PARAM(state); |
| 447 | auto& impl = thisObject.wrapped(); |
| 448 | JSValue result = toJS<IDLInterface<NodeList>>(state, *thisObject.globalObject(), throwScope, impl.labels()); |
| 449 | return result; |
| 450 | } |
| 451 | |
| 452 | EncodedJSValue jsHTMLKeygenElementLabels(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 453 | { |
| 454 | return IDLAttribute<JSHTMLKeygenElement>::get<jsHTMLKeygenElementLabelsGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "labels" ); |
| 455 | } |
| 456 | |
| 457 | static inline JSC::EncodedJSValue jsHTMLKeygenElementPrototypeFunctionCheckValidityBody(JSC::ExecState* state, typename IDLOperation<JSHTMLKeygenElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 458 | { |
| 459 | UNUSED_PARAM(state); |
| 460 | UNUSED_PARAM(throwScope); |
| 461 | auto& impl = castedThis->wrapped(); |
| 462 | return JSValue::encode(toJS<IDLBoolean>(impl.checkValidity())); |
| 463 | } |
| 464 | |
| 465 | EncodedJSValue JSC_HOST_CALL jsHTMLKeygenElementPrototypeFunctionCheckValidity(ExecState* state) |
| 466 | { |
| 467 | return IDLOperation<JSHTMLKeygenElement>::call<jsHTMLKeygenElementPrototypeFunctionCheckValidityBody>(*state, "checkValidity" ); |
| 468 | } |
| 469 | |
| 470 | static inline JSC::EncodedJSValue jsHTMLKeygenElementPrototypeFunctionReportValidityBody(JSC::ExecState* state, typename IDLOperation<JSHTMLKeygenElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 471 | { |
| 472 | UNUSED_PARAM(state); |
| 473 | UNUSED_PARAM(throwScope); |
| 474 | auto& impl = castedThis->wrapped(); |
| 475 | return JSValue::encode(toJS<IDLBoolean>(impl.reportValidity())); |
| 476 | } |
| 477 | |
| 478 | EncodedJSValue JSC_HOST_CALL jsHTMLKeygenElementPrototypeFunctionReportValidity(ExecState* state) |
| 479 | { |
| 480 | return IDLOperation<JSHTMLKeygenElement>::call<jsHTMLKeygenElementPrototypeFunctionReportValidityBody>(*state, "reportValidity" ); |
| 481 | } |
| 482 | |
| 483 | static inline JSC::EncodedJSValue jsHTMLKeygenElementPrototypeFunctionSetCustomValidityBody(JSC::ExecState* state, typename IDLOperation<JSHTMLKeygenElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 484 | { |
| 485 | UNUSED_PARAM(state); |
| 486 | UNUSED_PARAM(throwScope); |
| 487 | auto& impl = castedThis->wrapped(); |
| 488 | if (UNLIKELY(state->argumentCount() < 1)) |
| 489 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| 490 | auto error = convert<IDLDOMString>(*state, state->uncheckedArgument(0)); |
| 491 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 492 | impl.setCustomValidity(WTFMove(error)); |
| 493 | return JSValue::encode(jsUndefined()); |
| 494 | } |
| 495 | |
| 496 | EncodedJSValue JSC_HOST_CALL jsHTMLKeygenElementPrototypeFunctionSetCustomValidity(ExecState* state) |
| 497 | { |
| 498 | return IDLOperation<JSHTMLKeygenElement>::call<jsHTMLKeygenElementPrototypeFunctionSetCustomValidityBody>(*state, "setCustomValidity" ); |
| 499 | } |
| 500 | |
| 501 | void JSHTMLKeygenElement::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
| 502 | { |
| 503 | auto* thisObject = jsCast<JSHTMLKeygenElement*>(cell); |
| 504 | builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
| 505 | if (thisObject->scriptExecutionContext()) |
| 506 | builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
| 507 | Base::heapSnapshot(cell, builder); |
| 508 | } |
| 509 | |
| 510 | |
| 511 | } |
| 512 | |