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 "JSHTMLFieldSetElement.h" |
23 | |
24 | #include "CustomElementReactionQueue.h" |
25 | #include "HTMLNames.h" |
26 | #include "JSDOMAttribute.h" |
27 | #include "JSDOMBinding.h" |
28 | #include "JSDOMConstructorNotConstructable.h" |
29 | #include "JSDOMConvertBoolean.h" |
30 | #include "JSDOMConvertInterface.h" |
31 | #include "JSDOMConvertStrings.h" |
32 | #include "JSDOMExceptionHandling.h" |
33 | #include "JSDOMGlobalObject.h" |
34 | #include "JSDOMOperation.h" |
35 | #include "JSDOMWrapperCache.h" |
36 | #include "JSHTMLCollection.h" |
37 | #include "JSHTMLFormElement.h" |
38 | #include "JSValidityState.h" |
39 | #include "RuntimeEnabledFeatures.h" |
40 | #include "ScriptExecutionContext.h" |
41 | #include <JavaScriptCore/HeapSnapshotBuilder.h> |
42 | #include <JavaScriptCore/JSCInlines.h> |
43 | #include <wtf/GetPtr.h> |
44 | #include <wtf/PointerPreparations.h> |
45 | #include <wtf/URL.h> |
46 | |
47 | |
48 | namespace WebCore { |
49 | using namespace JSC; |
50 | |
51 | // Functions |
52 | |
53 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLFieldSetElementPrototypeFunctionCheckValidity(JSC::ExecState*); |
54 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLFieldSetElementPrototypeFunctionReportValidity(JSC::ExecState*); |
55 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLFieldSetElementPrototypeFunctionSetCustomValidity(JSC::ExecState*); |
56 | |
57 | // Attributes |
58 | |
59 | JSC::EncodedJSValue jsHTMLFieldSetElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
60 | bool setJSHTMLFieldSetElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
61 | JSC::EncodedJSValue jsHTMLFieldSetElementDisabled(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
62 | bool setJSHTMLFieldSetElementDisabled(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
63 | JSC::EncodedJSValue jsHTMLFieldSetElementForm(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
64 | JSC::EncodedJSValue jsHTMLFieldSetElementName(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
65 | bool setJSHTMLFieldSetElementName(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
66 | JSC::EncodedJSValue jsHTMLFieldSetElementType(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
67 | JSC::EncodedJSValue jsHTMLFieldSetElementElements(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
68 | JSC::EncodedJSValue jsHTMLFieldSetElementWillValidate(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
69 | JSC::EncodedJSValue jsHTMLFieldSetElementValidity(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
70 | JSC::EncodedJSValue jsHTMLFieldSetElementValidationMessage(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
71 | |
72 | class JSHTMLFieldSetElementPrototype : public JSC::JSNonFinalObject { |
73 | public: |
74 | using Base = JSC::JSNonFinalObject; |
75 | static JSHTMLFieldSetElementPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
76 | { |
77 | JSHTMLFieldSetElementPrototype* ptr = new (NotNull, JSC::allocateCell<JSHTMLFieldSetElementPrototype>(vm.heap)) JSHTMLFieldSetElementPrototype(vm, globalObject, structure); |
78 | ptr->finishCreation(vm); |
79 | return ptr; |
80 | } |
81 | |
82 | DECLARE_INFO; |
83 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
84 | { |
85 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
86 | } |
87 | |
88 | private: |
89 | JSHTMLFieldSetElementPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
90 | : JSC::JSNonFinalObject(vm, structure) |
91 | { |
92 | } |
93 | |
94 | void finishCreation(JSC::VM&); |
95 | }; |
96 | |
97 | using JSHTMLFieldSetElementConstructor = JSDOMConstructorNotConstructable<JSHTMLFieldSetElement>; |
98 | |
99 | template<> JSValue JSHTMLFieldSetElementConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
100 | { |
101 | return JSHTMLElement::getConstructor(vm, &globalObject); |
102 | } |
103 | |
104 | template<> void JSHTMLFieldSetElementConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
105 | { |
106 | putDirect(vm, vm.propertyNames->prototype, JSHTMLFieldSetElement::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
107 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("HTMLFieldSetElement"_s )), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
108 | putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
109 | } |
110 | |
111 | template<> const ClassInfo JSHTMLFieldSetElementConstructor::s_info = { "HTMLFieldSetElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSHTMLFieldSetElementConstructor) }; |
112 | |
113 | /* Hash table for prototype */ |
114 | |
115 | static const HashTableValue JSHTMLFieldSetElementPrototypeTableValues[] = |
116 | { |
117 | { "constructor" , static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFieldSetElementConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLFieldSetElementConstructor) } }, |
118 | { "disabled" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFieldSetElementDisabled), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLFieldSetElementDisabled) } }, |
119 | { "form" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFieldSetElementForm), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
120 | { "name" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFieldSetElementName), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLFieldSetElementName) } }, |
121 | { "type" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFieldSetElementType), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
122 | { "elements" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFieldSetElementElements), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
123 | { "willValidate" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFieldSetElementWillValidate), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
124 | { "validity" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFieldSetElementValidity), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
125 | { "validationMessage" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFieldSetElementValidationMessage), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
126 | { "checkValidity" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLFieldSetElementPrototypeFunctionCheckValidity), (intptr_t) (0) } }, |
127 | { "reportValidity" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLFieldSetElementPrototypeFunctionReportValidity), (intptr_t) (0) } }, |
128 | { "setCustomValidity" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLFieldSetElementPrototypeFunctionSetCustomValidity), (intptr_t) (1) } }, |
129 | }; |
130 | |
131 | const ClassInfo JSHTMLFieldSetElementPrototype::s_info = { "HTMLFieldSetElementPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSHTMLFieldSetElementPrototype) }; |
132 | |
133 | void JSHTMLFieldSetElementPrototype::finishCreation(VM& vm) |
134 | { |
135 | Base::finishCreation(vm); |
136 | reifyStaticProperties(vm, JSHTMLFieldSetElement::info(), JSHTMLFieldSetElementPrototypeTableValues, *this); |
137 | bool hasDisabledRuntimeProperties = false; |
138 | if (!RuntimeEnabledFeatures::sharedFeatures().interactiveFormValidationEnabled()) { |
139 | hasDisabledRuntimeProperties = true; |
140 | auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("reportValidity" ), strlen("reportValidity" )); |
141 | VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); |
142 | JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); |
143 | } |
144 | if (hasDisabledRuntimeProperties && structure()->isDictionary()) |
145 | flattenDictionaryObject(vm); |
146 | } |
147 | |
148 | const ClassInfo JSHTMLFieldSetElement::s_info = { "HTMLFieldSetElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSHTMLFieldSetElement) }; |
149 | |
150 | JSHTMLFieldSetElement::JSHTMLFieldSetElement(Structure* structure, JSDOMGlobalObject& globalObject, Ref<HTMLFieldSetElement>&& impl) |
151 | : JSHTMLElement(structure, globalObject, WTFMove(impl)) |
152 | { |
153 | } |
154 | |
155 | void JSHTMLFieldSetElement::finishCreation(VM& vm) |
156 | { |
157 | Base::finishCreation(vm); |
158 | ASSERT(inherits(vm, info())); |
159 | |
160 | } |
161 | |
162 | JSObject* JSHTMLFieldSetElement::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
163 | { |
164 | return JSHTMLFieldSetElementPrototype::create(vm, &globalObject, JSHTMLFieldSetElementPrototype::createStructure(vm, &globalObject, JSHTMLElement::prototype(vm, globalObject))); |
165 | } |
166 | |
167 | JSObject* JSHTMLFieldSetElement::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
168 | { |
169 | return getDOMPrototype<JSHTMLFieldSetElement>(vm, globalObject); |
170 | } |
171 | |
172 | JSValue JSHTMLFieldSetElement::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
173 | { |
174 | return getDOMConstructor<JSHTMLFieldSetElementConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
175 | } |
176 | |
177 | template<> inline JSHTMLFieldSetElement* IDLAttribute<JSHTMLFieldSetElement>::cast(ExecState& state, EncodedJSValue thisValue) |
178 | { |
179 | return jsDynamicCast<JSHTMLFieldSetElement*>(state.vm(), JSValue::decode(thisValue)); |
180 | } |
181 | |
182 | template<> inline JSHTMLFieldSetElement* IDLOperation<JSHTMLFieldSetElement>::cast(ExecState& state) |
183 | { |
184 | return jsDynamicCast<JSHTMLFieldSetElement*>(state.vm(), state.thisValue()); |
185 | } |
186 | |
187 | EncodedJSValue jsHTMLFieldSetElementConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
188 | { |
189 | VM& vm = state->vm(); |
190 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
191 | auto* prototype = jsDynamicCast<JSHTMLFieldSetElementPrototype*>(vm, JSValue::decode(thisValue)); |
192 | if (UNLIKELY(!prototype)) |
193 | return throwVMTypeError(state, throwScope); |
194 | return JSValue::encode(JSHTMLFieldSetElement::getConstructor(state->vm(), prototype->globalObject())); |
195 | } |
196 | |
197 | bool setJSHTMLFieldSetElementConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
198 | { |
199 | VM& vm = state->vm(); |
200 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
201 | auto* prototype = jsDynamicCast<JSHTMLFieldSetElementPrototype*>(vm, JSValue::decode(thisValue)); |
202 | if (UNLIKELY(!prototype)) { |
203 | throwVMTypeError(state, throwScope); |
204 | return false; |
205 | } |
206 | // Shadowing a built-in constructor |
207 | return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue)); |
208 | } |
209 | |
210 | static inline JSValue jsHTMLFieldSetElementDisabledGetter(ExecState& state, JSHTMLFieldSetElement& thisObject, ThrowScope& throwScope) |
211 | { |
212 | UNUSED_PARAM(throwScope); |
213 | UNUSED_PARAM(state); |
214 | auto& impl = thisObject.wrapped(); |
215 | JSValue result = toJS<IDLBoolean>(state, throwScope, impl.hasAttributeWithoutSynchronization(WebCore::HTMLNames::disabledAttr)); |
216 | return result; |
217 | } |
218 | |
219 | EncodedJSValue jsHTMLFieldSetElementDisabled(ExecState* state, EncodedJSValue thisValue, PropertyName) |
220 | { |
221 | return IDLAttribute<JSHTMLFieldSetElement>::get<jsHTMLFieldSetElementDisabledGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "disabled" ); |
222 | } |
223 | |
224 | static inline bool setJSHTMLFieldSetElementDisabledSetter(ExecState& state, JSHTMLFieldSetElement& thisObject, JSValue value, ThrowScope& throwScope) |
225 | { |
226 | UNUSED_PARAM(throwScope); |
227 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
228 | auto& impl = thisObject.wrapped(); |
229 | auto nativeValue = convert<IDLBoolean>(state, value); |
230 | RETURN_IF_EXCEPTION(throwScope, false); |
231 | AttributeSetter::call(state, throwScope, [&] { |
232 | return impl.setBooleanAttribute(WebCore::HTMLNames::disabledAttr, WTFMove(nativeValue)); |
233 | }); |
234 | return true; |
235 | } |
236 | |
237 | bool setJSHTMLFieldSetElementDisabled(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
238 | { |
239 | return IDLAttribute<JSHTMLFieldSetElement>::set<setJSHTMLFieldSetElementDisabledSetter>(*state, thisValue, encodedValue, "disabled" ); |
240 | } |
241 | |
242 | static inline JSValue jsHTMLFieldSetElementFormGetter(ExecState& state, JSHTMLFieldSetElement& thisObject, ThrowScope& throwScope) |
243 | { |
244 | UNUSED_PARAM(throwScope); |
245 | UNUSED_PARAM(state); |
246 | auto& impl = thisObject.wrapped(); |
247 | JSValue result = toJS<IDLInterface<HTMLFormElement>>(state, *thisObject.globalObject(), throwScope, impl.form()); |
248 | return result; |
249 | } |
250 | |
251 | EncodedJSValue jsHTMLFieldSetElementForm(ExecState* state, EncodedJSValue thisValue, PropertyName) |
252 | { |
253 | return IDLAttribute<JSHTMLFieldSetElement>::get<jsHTMLFieldSetElementFormGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "form" ); |
254 | } |
255 | |
256 | static inline JSValue jsHTMLFieldSetElementNameGetter(ExecState& state, JSHTMLFieldSetElement& thisObject, ThrowScope& throwScope) |
257 | { |
258 | UNUSED_PARAM(throwScope); |
259 | UNUSED_PARAM(state); |
260 | auto& impl = thisObject.wrapped(); |
261 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.getNameAttribute()); |
262 | return result; |
263 | } |
264 | |
265 | EncodedJSValue jsHTMLFieldSetElementName(ExecState* state, EncodedJSValue thisValue, PropertyName) |
266 | { |
267 | return IDLAttribute<JSHTMLFieldSetElement>::get<jsHTMLFieldSetElementNameGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "name" ); |
268 | } |
269 | |
270 | static inline bool setJSHTMLFieldSetElementNameSetter(ExecState& state, JSHTMLFieldSetElement& thisObject, JSValue value, ThrowScope& throwScope) |
271 | { |
272 | UNUSED_PARAM(throwScope); |
273 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
274 | auto& impl = thisObject.wrapped(); |
275 | auto nativeValue = convert<IDLDOMString>(state, value); |
276 | RETURN_IF_EXCEPTION(throwScope, false); |
277 | AttributeSetter::call(state, throwScope, [&] { |
278 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::nameAttr, WTFMove(nativeValue)); |
279 | }); |
280 | return true; |
281 | } |
282 | |
283 | bool setJSHTMLFieldSetElementName(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
284 | { |
285 | return IDLAttribute<JSHTMLFieldSetElement>::set<setJSHTMLFieldSetElementNameSetter>(*state, thisValue, encodedValue, "name" ); |
286 | } |
287 | |
288 | static inline JSValue jsHTMLFieldSetElementTypeGetter(ExecState& state, JSHTMLFieldSetElement& thisObject, ThrowScope& throwScope) |
289 | { |
290 | UNUSED_PARAM(throwScope); |
291 | UNUSED_PARAM(state); |
292 | auto& impl = thisObject.wrapped(); |
293 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.type()); |
294 | return result; |
295 | } |
296 | |
297 | EncodedJSValue jsHTMLFieldSetElementType(ExecState* state, EncodedJSValue thisValue, PropertyName) |
298 | { |
299 | return IDLAttribute<JSHTMLFieldSetElement>::get<jsHTMLFieldSetElementTypeGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "type" ); |
300 | } |
301 | |
302 | static inline JSValue jsHTMLFieldSetElementElementsGetter(ExecState& state, JSHTMLFieldSetElement& thisObject, ThrowScope& throwScope) |
303 | { |
304 | UNUSED_PARAM(throwScope); |
305 | UNUSED_PARAM(state); |
306 | auto& impl = thisObject.wrapped(); |
307 | JSValue result = toJS<IDLInterface<HTMLCollection>>(state, *thisObject.globalObject(), throwScope, impl.elements()); |
308 | return result; |
309 | } |
310 | |
311 | EncodedJSValue jsHTMLFieldSetElementElements(ExecState* state, EncodedJSValue thisValue, PropertyName) |
312 | { |
313 | return IDLAttribute<JSHTMLFieldSetElement>::get<jsHTMLFieldSetElementElementsGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "elements" ); |
314 | } |
315 | |
316 | static inline JSValue jsHTMLFieldSetElementWillValidateGetter(ExecState& state, JSHTMLFieldSetElement& thisObject, ThrowScope& throwScope) |
317 | { |
318 | UNUSED_PARAM(throwScope); |
319 | UNUSED_PARAM(state); |
320 | auto& impl = thisObject.wrapped(); |
321 | JSValue result = toJS<IDLBoolean>(state, throwScope, impl.willValidate()); |
322 | return result; |
323 | } |
324 | |
325 | EncodedJSValue jsHTMLFieldSetElementWillValidate(ExecState* state, EncodedJSValue thisValue, PropertyName) |
326 | { |
327 | return IDLAttribute<JSHTMLFieldSetElement>::get<jsHTMLFieldSetElementWillValidateGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "willValidate" ); |
328 | } |
329 | |
330 | static inline JSValue jsHTMLFieldSetElementValidityGetter(ExecState& state, JSHTMLFieldSetElement& thisObject, ThrowScope& throwScope) |
331 | { |
332 | UNUSED_PARAM(throwScope); |
333 | UNUSED_PARAM(state); |
334 | auto& impl = thisObject.wrapped(); |
335 | JSValue result = toJS<IDLInterface<ValidityState>>(state, *thisObject.globalObject(), throwScope, impl.validity()); |
336 | return result; |
337 | } |
338 | |
339 | EncodedJSValue jsHTMLFieldSetElementValidity(ExecState* state, EncodedJSValue thisValue, PropertyName) |
340 | { |
341 | return IDLAttribute<JSHTMLFieldSetElement>::get<jsHTMLFieldSetElementValidityGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "validity" ); |
342 | } |
343 | |
344 | static inline JSValue jsHTMLFieldSetElementValidationMessageGetter(ExecState& state, JSHTMLFieldSetElement& thisObject, ThrowScope& throwScope) |
345 | { |
346 | UNUSED_PARAM(throwScope); |
347 | UNUSED_PARAM(state); |
348 | auto& impl = thisObject.wrapped(); |
349 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.validationMessage()); |
350 | return result; |
351 | } |
352 | |
353 | EncodedJSValue jsHTMLFieldSetElementValidationMessage(ExecState* state, EncodedJSValue thisValue, PropertyName) |
354 | { |
355 | return IDLAttribute<JSHTMLFieldSetElement>::get<jsHTMLFieldSetElementValidationMessageGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "validationMessage" ); |
356 | } |
357 | |
358 | static inline JSC::EncodedJSValue jsHTMLFieldSetElementPrototypeFunctionCheckValidityBody(JSC::ExecState* state, typename IDLOperation<JSHTMLFieldSetElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
359 | { |
360 | UNUSED_PARAM(state); |
361 | UNUSED_PARAM(throwScope); |
362 | auto& impl = castedThis->wrapped(); |
363 | return JSValue::encode(toJS<IDLBoolean>(impl.checkValidity())); |
364 | } |
365 | |
366 | EncodedJSValue JSC_HOST_CALL jsHTMLFieldSetElementPrototypeFunctionCheckValidity(ExecState* state) |
367 | { |
368 | return IDLOperation<JSHTMLFieldSetElement>::call<jsHTMLFieldSetElementPrototypeFunctionCheckValidityBody>(*state, "checkValidity" ); |
369 | } |
370 | |
371 | static inline JSC::EncodedJSValue jsHTMLFieldSetElementPrototypeFunctionReportValidityBody(JSC::ExecState* state, typename IDLOperation<JSHTMLFieldSetElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
372 | { |
373 | UNUSED_PARAM(state); |
374 | UNUSED_PARAM(throwScope); |
375 | auto& impl = castedThis->wrapped(); |
376 | return JSValue::encode(toJS<IDLBoolean>(impl.reportValidity())); |
377 | } |
378 | |
379 | EncodedJSValue JSC_HOST_CALL jsHTMLFieldSetElementPrototypeFunctionReportValidity(ExecState* state) |
380 | { |
381 | return IDLOperation<JSHTMLFieldSetElement>::call<jsHTMLFieldSetElementPrototypeFunctionReportValidityBody>(*state, "reportValidity" ); |
382 | } |
383 | |
384 | static inline JSC::EncodedJSValue jsHTMLFieldSetElementPrototypeFunctionSetCustomValidityBody(JSC::ExecState* state, typename IDLOperation<JSHTMLFieldSetElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
385 | { |
386 | UNUSED_PARAM(state); |
387 | UNUSED_PARAM(throwScope); |
388 | auto& impl = castedThis->wrapped(); |
389 | if (UNLIKELY(state->argumentCount() < 1)) |
390 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
391 | auto error = convert<IDLDOMString>(*state, state->uncheckedArgument(0)); |
392 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
393 | impl.setCustomValidity(WTFMove(error)); |
394 | return JSValue::encode(jsUndefined()); |
395 | } |
396 | |
397 | EncodedJSValue JSC_HOST_CALL jsHTMLFieldSetElementPrototypeFunctionSetCustomValidity(ExecState* state) |
398 | { |
399 | return IDLOperation<JSHTMLFieldSetElement>::call<jsHTMLFieldSetElementPrototypeFunctionSetCustomValidityBody>(*state, "setCustomValidity" ); |
400 | } |
401 | |
402 | void JSHTMLFieldSetElement::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
403 | { |
404 | auto* thisObject = jsCast<JSHTMLFieldSetElement*>(cell); |
405 | builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
406 | if (thisObject->scriptExecutionContext()) |
407 | builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
408 | Base::heapSnapshot(cell, builder); |
409 | } |
410 | |
411 | |
412 | } |
413 | |