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 "JSHTMLInputElement.h" |
23 | |
24 | #include "CustomElementReactionQueue.h" |
25 | #include "HTMLInputElementEntriesAPI.h" |
26 | #include "HTMLNames.h" |
27 | #include "JSDOMAttribute.h" |
28 | #include "JSDOMBinding.h" |
29 | #include "JSDOMConstructorNotConstructable.h" |
30 | #include "JSDOMConvertBoolean.h" |
31 | #include "JSDOMConvertDate.h" |
32 | #include "JSDOMConvertInterface.h" |
33 | #include "JSDOMConvertNullable.h" |
34 | #include "JSDOMConvertNumbers.h" |
35 | #include "JSDOMConvertSequences.h" |
36 | #include "JSDOMConvertStrings.h" |
37 | #include "JSDOMExceptionHandling.h" |
38 | #include "JSDOMGlobalObject.h" |
39 | #include "JSDOMOperation.h" |
40 | #include "JSDOMWrapperCache.h" |
41 | #include "JSFileList.h" |
42 | #include "JSFileSystemEntry.h" |
43 | #include "JSHTMLFormElement.h" |
44 | #include "JSNodeList.h" |
45 | #include "JSValidityState.h" |
46 | #include "RuntimeEnabledFeatures.h" |
47 | #include "ScriptExecutionContext.h" |
48 | #include <JavaScriptCore/HeapSnapshotBuilder.h> |
49 | #include <JavaScriptCore/JSArray.h> |
50 | #include <JavaScriptCore/JSCInlines.h> |
51 | #include <wtf/GetPtr.h> |
52 | #include <wtf/PointerPreparations.h> |
53 | #include <wtf/URL.h> |
54 | |
55 | |
56 | namespace WebCore { |
57 | using namespace JSC; |
58 | |
59 | // Functions |
60 | |
61 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLInputElementPrototypeFunctionStepUp(JSC::ExecState*); |
62 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLInputElementPrototypeFunctionStepDown(JSC::ExecState*); |
63 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLInputElementPrototypeFunctionCheckValidity(JSC::ExecState*); |
64 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLInputElementPrototypeFunctionReportValidity(JSC::ExecState*); |
65 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLInputElementPrototypeFunctionSetCustomValidity(JSC::ExecState*); |
66 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLInputElementPrototypeFunctionSelect(JSC::ExecState*); |
67 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLInputElementPrototypeFunctionSetRangeText(JSC::ExecState*); |
68 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLInputElementPrototypeFunctionSetSelectionRange(JSC::ExecState*); |
69 | |
70 | // Attributes |
71 | |
72 | JSC::EncodedJSValue jsHTMLInputElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
73 | bool setJSHTMLInputElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
74 | JSC::EncodedJSValue jsHTMLInputElementAccept(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
75 | bool setJSHTMLInputElementAccept(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
76 | JSC::EncodedJSValue jsHTMLInputElementAlt(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
77 | bool setJSHTMLInputElementAlt(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
78 | JSC::EncodedJSValue jsHTMLInputElementAutocomplete(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
79 | bool setJSHTMLInputElementAutocomplete(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
80 | JSC::EncodedJSValue jsHTMLInputElementAutofocus(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
81 | bool setJSHTMLInputElementAutofocus(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
82 | JSC::EncodedJSValue jsHTMLInputElementDefaultChecked(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
83 | bool setJSHTMLInputElementDefaultChecked(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
84 | JSC::EncodedJSValue jsHTMLInputElementChecked(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
85 | bool setJSHTMLInputElementChecked(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
86 | JSC::EncodedJSValue jsHTMLInputElementDirName(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
87 | bool setJSHTMLInputElementDirName(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
88 | JSC::EncodedJSValue jsHTMLInputElementDisabled(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
89 | bool setJSHTMLInputElementDisabled(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
90 | JSC::EncodedJSValue jsHTMLInputElementForm(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
91 | JSC::EncodedJSValue jsHTMLInputElementFiles(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
92 | bool setJSHTMLInputElementFiles(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
93 | JSC::EncodedJSValue jsHTMLInputElementFormAction(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
94 | bool setJSHTMLInputElementFormAction(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
95 | JSC::EncodedJSValue jsHTMLInputElementFormEnctype(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
96 | bool setJSHTMLInputElementFormEnctype(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
97 | JSC::EncodedJSValue jsHTMLInputElementFormMethod(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
98 | bool setJSHTMLInputElementFormMethod(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
99 | JSC::EncodedJSValue jsHTMLInputElementFormNoValidate(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
100 | bool setJSHTMLInputElementFormNoValidate(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
101 | JSC::EncodedJSValue jsHTMLInputElementFormTarget(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
102 | bool setJSHTMLInputElementFormTarget(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
103 | JSC::EncodedJSValue jsHTMLInputElementHeight(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
104 | bool setJSHTMLInputElementHeight(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
105 | JSC::EncodedJSValue jsHTMLInputElementIndeterminate(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
106 | bool setJSHTMLInputElementIndeterminate(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
107 | #if ENABLE(DATALIST_ELEMENT) |
108 | JSC::EncodedJSValue jsHTMLInputElementList(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
109 | #endif |
110 | JSC::EncodedJSValue jsHTMLInputElementMax(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
111 | bool setJSHTMLInputElementMax(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
112 | JSC::EncodedJSValue jsHTMLInputElementMinLength(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
113 | bool setJSHTMLInputElementMinLength(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
114 | JSC::EncodedJSValue jsHTMLInputElementMaxLength(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
115 | bool setJSHTMLInputElementMaxLength(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
116 | JSC::EncodedJSValue jsHTMLInputElementMin(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
117 | bool setJSHTMLInputElementMin(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
118 | JSC::EncodedJSValue jsHTMLInputElementMultiple(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
119 | bool setJSHTMLInputElementMultiple(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
120 | JSC::EncodedJSValue jsHTMLInputElementName(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
121 | bool setJSHTMLInputElementName(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
122 | JSC::EncodedJSValue jsHTMLInputElementPattern(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
123 | bool setJSHTMLInputElementPattern(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
124 | JSC::EncodedJSValue jsHTMLInputElementPlaceholder(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
125 | bool setJSHTMLInputElementPlaceholder(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
126 | JSC::EncodedJSValue jsHTMLInputElementReadOnly(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
127 | bool setJSHTMLInputElementReadOnly(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
128 | JSC::EncodedJSValue jsHTMLInputElementRequired(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
129 | bool setJSHTMLInputElementRequired(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
130 | JSC::EncodedJSValue jsHTMLInputElementSize(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
131 | bool setJSHTMLInputElementSize(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
132 | JSC::EncodedJSValue jsHTMLInputElementSrc(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
133 | bool setJSHTMLInputElementSrc(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
134 | JSC::EncodedJSValue jsHTMLInputElementStep(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
135 | bool setJSHTMLInputElementStep(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
136 | JSC::EncodedJSValue jsHTMLInputElementType(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
137 | bool setJSHTMLInputElementType(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
138 | JSC::EncodedJSValue jsHTMLInputElementDefaultValue(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
139 | bool setJSHTMLInputElementDefaultValue(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
140 | JSC::EncodedJSValue jsHTMLInputElementValue(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
141 | bool setJSHTMLInputElementValue(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
142 | JSC::EncodedJSValue jsHTMLInputElementValueAsDate(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
143 | bool setJSHTMLInputElementValueAsDate(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
144 | JSC::EncodedJSValue jsHTMLInputElementValueAsNumber(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
145 | bool setJSHTMLInputElementValueAsNumber(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
146 | JSC::EncodedJSValue jsHTMLInputElementWidth(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
147 | bool setJSHTMLInputElementWidth(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
148 | JSC::EncodedJSValue jsHTMLInputElementWillValidate(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
149 | JSC::EncodedJSValue jsHTMLInputElementValidity(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
150 | JSC::EncodedJSValue jsHTMLInputElementValidationMessage(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
151 | JSC::EncodedJSValue jsHTMLInputElementLabels(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
152 | JSC::EncodedJSValue jsHTMLInputElementSelectionStart(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
153 | bool setJSHTMLInputElementSelectionStart(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
154 | JSC::EncodedJSValue jsHTMLInputElementSelectionEnd(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
155 | bool setJSHTMLInputElementSelectionEnd(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
156 | JSC::EncodedJSValue jsHTMLInputElementSelectionDirection(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
157 | bool setJSHTMLInputElementSelectionDirection(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
158 | JSC::EncodedJSValue jsHTMLInputElementAlign(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
159 | bool setJSHTMLInputElementAlign(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
160 | JSC::EncodedJSValue jsHTMLInputElementUseMap(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
161 | bool setJSHTMLInputElementUseMap(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
162 | JSC::EncodedJSValue jsHTMLInputElementIncremental(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
163 | bool setJSHTMLInputElementIncremental(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
164 | #if ENABLE(MEDIA_CAPTURE) |
165 | JSC::EncodedJSValue jsHTMLInputElementCapture(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
166 | bool setJSHTMLInputElementCapture(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
167 | #endif |
168 | JSC::EncodedJSValue jsHTMLInputElementWebkitdirectory(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
169 | bool setJSHTMLInputElementWebkitdirectory(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
170 | JSC::EncodedJSValue jsHTMLInputElementWebkitEntries(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
171 | |
172 | class JSHTMLInputElementPrototype : public JSC::JSNonFinalObject { |
173 | public: |
174 | using Base = JSC::JSNonFinalObject; |
175 | static JSHTMLInputElementPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
176 | { |
177 | JSHTMLInputElementPrototype* ptr = new (NotNull, JSC::allocateCell<JSHTMLInputElementPrototype>(vm.heap)) JSHTMLInputElementPrototype(vm, globalObject, structure); |
178 | ptr->finishCreation(vm); |
179 | return ptr; |
180 | } |
181 | |
182 | DECLARE_INFO; |
183 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
184 | { |
185 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
186 | } |
187 | |
188 | private: |
189 | JSHTMLInputElementPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
190 | : JSC::JSNonFinalObject(vm, structure) |
191 | { |
192 | } |
193 | |
194 | void finishCreation(JSC::VM&); |
195 | }; |
196 | |
197 | using JSHTMLInputElementConstructor = JSDOMConstructorNotConstructable<JSHTMLInputElement>; |
198 | |
199 | template<> JSValue JSHTMLInputElementConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
200 | { |
201 | return JSHTMLElement::getConstructor(vm, &globalObject); |
202 | } |
203 | |
204 | template<> void JSHTMLInputElementConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
205 | { |
206 | putDirect(vm, vm.propertyNames->prototype, JSHTMLInputElement::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
207 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("HTMLInputElement"_s )), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
208 | putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
209 | } |
210 | |
211 | template<> const ClassInfo JSHTMLInputElementConstructor::s_info = { "HTMLInputElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSHTMLInputElementConstructor) }; |
212 | |
213 | /* Hash table for prototype */ |
214 | |
215 | static const HashTableValue JSHTMLInputElementPrototypeTableValues[] = |
216 | { |
217 | { "constructor" , static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementConstructor) } }, |
218 | { "accept" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementAccept), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementAccept) } }, |
219 | { "alt" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementAlt), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementAlt) } }, |
220 | { "autocomplete" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementAutocomplete), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementAutocomplete) } }, |
221 | { "autofocus" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementAutofocus), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementAutofocus) } }, |
222 | { "defaultChecked" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementDefaultChecked), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementDefaultChecked) } }, |
223 | { "checked" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementChecked), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementChecked) } }, |
224 | { "dirName" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementDirName), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementDirName) } }, |
225 | { "disabled" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementDisabled), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementDisabled) } }, |
226 | { "form" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementForm), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
227 | { "files" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementFiles), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementFiles) } }, |
228 | { "formAction" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementFormAction), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementFormAction) } }, |
229 | { "formEnctype" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementFormEnctype), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementFormEnctype) } }, |
230 | { "formMethod" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementFormMethod), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementFormMethod) } }, |
231 | { "formNoValidate" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementFormNoValidate), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementFormNoValidate) } }, |
232 | { "formTarget" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementFormTarget), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementFormTarget) } }, |
233 | { "height" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementHeight), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementHeight) } }, |
234 | { "indeterminate" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementIndeterminate), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementIndeterminate) } }, |
235 | #if ENABLE(DATALIST_ELEMENT) |
236 | { "list" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementList), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
237 | #else |
238 | { 0, 0, NoIntrinsic, { 0, 0 } }, |
239 | #endif |
240 | { "max" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementMax), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementMax) } }, |
241 | { "minLength" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementMinLength), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementMinLength) } }, |
242 | { "maxLength" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementMaxLength), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementMaxLength) } }, |
243 | { "min" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementMin), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementMin) } }, |
244 | { "multiple" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementMultiple), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementMultiple) } }, |
245 | { "name" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementName), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementName) } }, |
246 | { "pattern" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementPattern), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementPattern) } }, |
247 | { "placeholder" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementPlaceholder), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementPlaceholder) } }, |
248 | { "readOnly" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementReadOnly), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementReadOnly) } }, |
249 | { "required" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementRequired), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementRequired) } }, |
250 | { "size" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementSize), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementSize) } }, |
251 | { "src" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementSrc), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementSrc) } }, |
252 | { "step" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementStep), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementStep) } }, |
253 | { "type" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementType), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementType) } }, |
254 | { "defaultValue" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementDefaultValue), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementDefaultValue) } }, |
255 | { "value" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementValue), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementValue) } }, |
256 | { "valueAsDate" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementValueAsDate), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementValueAsDate) } }, |
257 | { "valueAsNumber" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementValueAsNumber), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementValueAsNumber) } }, |
258 | { "width" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementWidth), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementWidth) } }, |
259 | { "willValidate" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementWillValidate), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
260 | { "validity" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementValidity), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
261 | { "validationMessage" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementValidationMessage), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
262 | { "labels" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementLabels), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
263 | { "selectionStart" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementSelectionStart), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementSelectionStart) } }, |
264 | { "selectionEnd" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementSelectionEnd), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementSelectionEnd) } }, |
265 | { "selectionDirection" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementSelectionDirection), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementSelectionDirection) } }, |
266 | { "align" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementAlign), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementAlign) } }, |
267 | { "useMap" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementUseMap), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementUseMap) } }, |
268 | { "incremental" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementIncremental), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementIncremental) } }, |
269 | #if ENABLE(MEDIA_CAPTURE) |
270 | { "capture" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementCapture), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementCapture) } }, |
271 | #else |
272 | { 0, 0, NoIntrinsic, { 0, 0 } }, |
273 | #endif |
274 | { "webkitdirectory" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementWebkitdirectory), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLInputElementWebkitdirectory) } }, |
275 | { "webkitEntries" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLInputElementWebkitEntries), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
276 | { "stepUp" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLInputElementPrototypeFunctionStepUp), (intptr_t) (0) } }, |
277 | { "stepDown" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLInputElementPrototypeFunctionStepDown), (intptr_t) (0) } }, |
278 | { "checkValidity" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLInputElementPrototypeFunctionCheckValidity), (intptr_t) (0) } }, |
279 | { "reportValidity" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLInputElementPrototypeFunctionReportValidity), (intptr_t) (0) } }, |
280 | { "setCustomValidity" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLInputElementPrototypeFunctionSetCustomValidity), (intptr_t) (1) } }, |
281 | { "select" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLInputElementPrototypeFunctionSelect), (intptr_t) (0) } }, |
282 | { "setRangeText" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLInputElementPrototypeFunctionSetRangeText), (intptr_t) (1) } }, |
283 | { "setSelectionRange" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLInputElementPrototypeFunctionSetSelectionRange), (intptr_t) (2) } }, |
284 | }; |
285 | |
286 | const ClassInfo JSHTMLInputElementPrototype::s_info = { "HTMLInputElementPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSHTMLInputElementPrototype) }; |
287 | |
288 | void JSHTMLInputElementPrototype::finishCreation(VM& vm) |
289 | { |
290 | Base::finishCreation(vm); |
291 | reifyStaticProperties(vm, JSHTMLInputElement::info(), JSHTMLInputElementPrototypeTableValues, *this); |
292 | bool hasDisabledRuntimeProperties = false; |
293 | if (!RuntimeEnabledFeatures::sharedFeatures().interactiveFormValidationEnabled()) { |
294 | hasDisabledRuntimeProperties = true; |
295 | auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("reportValidity" ), strlen("reportValidity" )); |
296 | VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); |
297 | JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); |
298 | } |
299 | if (!RuntimeEnabledFeatures::sharedFeatures().directoryUploadEnabled()) { |
300 | hasDisabledRuntimeProperties = true; |
301 | auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("webkitdirectory" ), strlen("webkitdirectory" )); |
302 | VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); |
303 | JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); |
304 | } |
305 | if (!RuntimeEnabledFeatures::sharedFeatures().directoryUploadEnabled()) { |
306 | hasDisabledRuntimeProperties = true; |
307 | auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("webkitEntries" ), strlen("webkitEntries" )); |
308 | VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); |
309 | JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); |
310 | } |
311 | if (hasDisabledRuntimeProperties && structure()->isDictionary()) |
312 | flattenDictionaryObject(vm); |
313 | } |
314 | |
315 | const ClassInfo JSHTMLInputElement::s_info = { "HTMLInputElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSHTMLInputElement) }; |
316 | |
317 | JSHTMLInputElement::JSHTMLInputElement(Structure* structure, JSDOMGlobalObject& globalObject, Ref<HTMLInputElement>&& impl) |
318 | : JSHTMLElement(structure, globalObject, WTFMove(impl)) |
319 | { |
320 | } |
321 | |
322 | void JSHTMLInputElement::finishCreation(VM& vm) |
323 | { |
324 | Base::finishCreation(vm); |
325 | ASSERT(inherits(vm, info())); |
326 | |
327 | } |
328 | |
329 | JSObject* JSHTMLInputElement::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
330 | { |
331 | return JSHTMLInputElementPrototype::create(vm, &globalObject, JSHTMLInputElementPrototype::createStructure(vm, &globalObject, JSHTMLElement::prototype(vm, globalObject))); |
332 | } |
333 | |
334 | JSObject* JSHTMLInputElement::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
335 | { |
336 | return getDOMPrototype<JSHTMLInputElement>(vm, globalObject); |
337 | } |
338 | |
339 | JSValue JSHTMLInputElement::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
340 | { |
341 | return getDOMConstructor<JSHTMLInputElementConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
342 | } |
343 | |
344 | template<> inline JSHTMLInputElement* IDLAttribute<JSHTMLInputElement>::cast(ExecState& state, EncodedJSValue thisValue) |
345 | { |
346 | return jsDynamicCast<JSHTMLInputElement*>(state.vm(), JSValue::decode(thisValue)); |
347 | } |
348 | |
349 | template<> inline JSHTMLInputElement* IDLOperation<JSHTMLInputElement>::cast(ExecState& state) |
350 | { |
351 | return jsDynamicCast<JSHTMLInputElement*>(state.vm(), state.thisValue()); |
352 | } |
353 | |
354 | EncodedJSValue jsHTMLInputElementConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
355 | { |
356 | VM& vm = state->vm(); |
357 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
358 | auto* prototype = jsDynamicCast<JSHTMLInputElementPrototype*>(vm, JSValue::decode(thisValue)); |
359 | if (UNLIKELY(!prototype)) |
360 | return throwVMTypeError(state, throwScope); |
361 | return JSValue::encode(JSHTMLInputElement::getConstructor(state->vm(), prototype->globalObject())); |
362 | } |
363 | |
364 | bool setJSHTMLInputElementConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
365 | { |
366 | VM& vm = state->vm(); |
367 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
368 | auto* prototype = jsDynamicCast<JSHTMLInputElementPrototype*>(vm, JSValue::decode(thisValue)); |
369 | if (UNLIKELY(!prototype)) { |
370 | throwVMTypeError(state, throwScope); |
371 | return false; |
372 | } |
373 | // Shadowing a built-in constructor |
374 | return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue)); |
375 | } |
376 | |
377 | static inline JSValue jsHTMLInputElementAcceptGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
378 | { |
379 | UNUSED_PARAM(throwScope); |
380 | UNUSED_PARAM(state); |
381 | auto& impl = thisObject.wrapped(); |
382 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::acceptAttr)); |
383 | return result; |
384 | } |
385 | |
386 | EncodedJSValue jsHTMLInputElementAccept(ExecState* state, EncodedJSValue thisValue, PropertyName) |
387 | { |
388 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementAcceptGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "accept" ); |
389 | } |
390 | |
391 | static inline bool setJSHTMLInputElementAcceptSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
392 | { |
393 | UNUSED_PARAM(throwScope); |
394 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
395 | auto& impl = thisObject.wrapped(); |
396 | auto nativeValue = convert<IDLDOMString>(state, value); |
397 | RETURN_IF_EXCEPTION(throwScope, false); |
398 | AttributeSetter::call(state, throwScope, [&] { |
399 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::acceptAttr, WTFMove(nativeValue)); |
400 | }); |
401 | return true; |
402 | } |
403 | |
404 | bool setJSHTMLInputElementAccept(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
405 | { |
406 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementAcceptSetter>(*state, thisValue, encodedValue, "accept" ); |
407 | } |
408 | |
409 | static inline JSValue jsHTMLInputElementAltGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
410 | { |
411 | UNUSED_PARAM(throwScope); |
412 | UNUSED_PARAM(state); |
413 | auto& impl = thisObject.wrapped(); |
414 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::altAttr)); |
415 | return result; |
416 | } |
417 | |
418 | EncodedJSValue jsHTMLInputElementAlt(ExecState* state, EncodedJSValue thisValue, PropertyName) |
419 | { |
420 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementAltGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "alt" ); |
421 | } |
422 | |
423 | static inline bool setJSHTMLInputElementAltSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
424 | { |
425 | UNUSED_PARAM(throwScope); |
426 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
427 | auto& impl = thisObject.wrapped(); |
428 | auto nativeValue = convert<IDLDOMString>(state, value); |
429 | RETURN_IF_EXCEPTION(throwScope, false); |
430 | AttributeSetter::call(state, throwScope, [&] { |
431 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::altAttr, WTFMove(nativeValue)); |
432 | }); |
433 | return true; |
434 | } |
435 | |
436 | bool setJSHTMLInputElementAlt(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
437 | { |
438 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementAltSetter>(*state, thisValue, encodedValue, "alt" ); |
439 | } |
440 | |
441 | static inline JSValue jsHTMLInputElementAutocompleteGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
442 | { |
443 | UNUSED_PARAM(throwScope); |
444 | UNUSED_PARAM(state); |
445 | auto& impl = thisObject.wrapped(); |
446 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.autocomplete()); |
447 | return result; |
448 | } |
449 | |
450 | EncodedJSValue jsHTMLInputElementAutocomplete(ExecState* state, EncodedJSValue thisValue, PropertyName) |
451 | { |
452 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementAutocompleteGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "autocomplete" ); |
453 | } |
454 | |
455 | static inline bool setJSHTMLInputElementAutocompleteSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
456 | { |
457 | UNUSED_PARAM(throwScope); |
458 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
459 | auto& impl = thisObject.wrapped(); |
460 | auto nativeValue = convert<IDLDOMString>(state, value); |
461 | RETURN_IF_EXCEPTION(throwScope, false); |
462 | AttributeSetter::call(state, throwScope, [&] { |
463 | return impl.setAutocomplete(WTFMove(nativeValue)); |
464 | }); |
465 | return true; |
466 | } |
467 | |
468 | bool setJSHTMLInputElementAutocomplete(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
469 | { |
470 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementAutocompleteSetter>(*state, thisValue, encodedValue, "autocomplete" ); |
471 | } |
472 | |
473 | static inline JSValue jsHTMLInputElementAutofocusGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
474 | { |
475 | UNUSED_PARAM(throwScope); |
476 | UNUSED_PARAM(state); |
477 | auto& impl = thisObject.wrapped(); |
478 | JSValue result = toJS<IDLBoolean>(state, throwScope, impl.hasAttributeWithoutSynchronization(WebCore::HTMLNames::autofocusAttr)); |
479 | return result; |
480 | } |
481 | |
482 | EncodedJSValue jsHTMLInputElementAutofocus(ExecState* state, EncodedJSValue thisValue, PropertyName) |
483 | { |
484 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementAutofocusGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "autofocus" ); |
485 | } |
486 | |
487 | static inline bool setJSHTMLInputElementAutofocusSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
488 | { |
489 | UNUSED_PARAM(throwScope); |
490 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
491 | auto& impl = thisObject.wrapped(); |
492 | auto nativeValue = convert<IDLBoolean>(state, value); |
493 | RETURN_IF_EXCEPTION(throwScope, false); |
494 | AttributeSetter::call(state, throwScope, [&] { |
495 | return impl.setBooleanAttribute(WebCore::HTMLNames::autofocusAttr, WTFMove(nativeValue)); |
496 | }); |
497 | return true; |
498 | } |
499 | |
500 | bool setJSHTMLInputElementAutofocus(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
501 | { |
502 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementAutofocusSetter>(*state, thisValue, encodedValue, "autofocus" ); |
503 | } |
504 | |
505 | static inline JSValue jsHTMLInputElementDefaultCheckedGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
506 | { |
507 | UNUSED_PARAM(throwScope); |
508 | UNUSED_PARAM(state); |
509 | auto& impl = thisObject.wrapped(); |
510 | JSValue result = toJS<IDLBoolean>(state, throwScope, impl.hasAttributeWithoutSynchronization(WebCore::HTMLNames::checkedAttr)); |
511 | return result; |
512 | } |
513 | |
514 | EncodedJSValue jsHTMLInputElementDefaultChecked(ExecState* state, EncodedJSValue thisValue, PropertyName) |
515 | { |
516 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementDefaultCheckedGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "defaultChecked" ); |
517 | } |
518 | |
519 | static inline bool setJSHTMLInputElementDefaultCheckedSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
520 | { |
521 | UNUSED_PARAM(throwScope); |
522 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
523 | auto& impl = thisObject.wrapped(); |
524 | auto nativeValue = convert<IDLBoolean>(state, value); |
525 | RETURN_IF_EXCEPTION(throwScope, false); |
526 | AttributeSetter::call(state, throwScope, [&] { |
527 | return impl.setBooleanAttribute(WebCore::HTMLNames::checkedAttr, WTFMove(nativeValue)); |
528 | }); |
529 | return true; |
530 | } |
531 | |
532 | bool setJSHTMLInputElementDefaultChecked(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
533 | { |
534 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementDefaultCheckedSetter>(*state, thisValue, encodedValue, "defaultChecked" ); |
535 | } |
536 | |
537 | static inline JSValue jsHTMLInputElementCheckedGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
538 | { |
539 | UNUSED_PARAM(throwScope); |
540 | UNUSED_PARAM(state); |
541 | auto& impl = thisObject.wrapped(); |
542 | JSValue result = toJS<IDLBoolean>(state, throwScope, impl.checked()); |
543 | return result; |
544 | } |
545 | |
546 | EncodedJSValue jsHTMLInputElementChecked(ExecState* state, EncodedJSValue thisValue, PropertyName) |
547 | { |
548 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementCheckedGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "checked" ); |
549 | } |
550 | |
551 | static inline bool setJSHTMLInputElementCheckedSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
552 | { |
553 | UNUSED_PARAM(throwScope); |
554 | auto& impl = thisObject.wrapped(); |
555 | auto nativeValue = convert<IDLBoolean>(state, value); |
556 | RETURN_IF_EXCEPTION(throwScope, false); |
557 | AttributeSetter::call(state, throwScope, [&] { |
558 | return impl.setChecked(WTFMove(nativeValue)); |
559 | }); |
560 | return true; |
561 | } |
562 | |
563 | bool setJSHTMLInputElementChecked(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
564 | { |
565 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementCheckedSetter>(*state, thisValue, encodedValue, "checked" ); |
566 | } |
567 | |
568 | static inline JSValue jsHTMLInputElementDirNameGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
569 | { |
570 | UNUSED_PARAM(throwScope); |
571 | UNUSED_PARAM(state); |
572 | auto& impl = thisObject.wrapped(); |
573 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::dirnameAttr)); |
574 | return result; |
575 | } |
576 | |
577 | EncodedJSValue jsHTMLInputElementDirName(ExecState* state, EncodedJSValue thisValue, PropertyName) |
578 | { |
579 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementDirNameGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "dirName" ); |
580 | } |
581 | |
582 | static inline bool setJSHTMLInputElementDirNameSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
583 | { |
584 | UNUSED_PARAM(throwScope); |
585 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
586 | auto& impl = thisObject.wrapped(); |
587 | auto nativeValue = convert<IDLDOMString>(state, value); |
588 | RETURN_IF_EXCEPTION(throwScope, false); |
589 | AttributeSetter::call(state, throwScope, [&] { |
590 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::dirnameAttr, WTFMove(nativeValue)); |
591 | }); |
592 | return true; |
593 | } |
594 | |
595 | bool setJSHTMLInputElementDirName(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
596 | { |
597 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementDirNameSetter>(*state, thisValue, encodedValue, "dirName" ); |
598 | } |
599 | |
600 | static inline JSValue jsHTMLInputElementDisabledGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
601 | { |
602 | UNUSED_PARAM(throwScope); |
603 | UNUSED_PARAM(state); |
604 | auto& impl = thisObject.wrapped(); |
605 | JSValue result = toJS<IDLBoolean>(state, throwScope, impl.hasAttributeWithoutSynchronization(WebCore::HTMLNames::disabledAttr)); |
606 | return result; |
607 | } |
608 | |
609 | EncodedJSValue jsHTMLInputElementDisabled(ExecState* state, EncodedJSValue thisValue, PropertyName) |
610 | { |
611 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementDisabledGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "disabled" ); |
612 | } |
613 | |
614 | static inline bool setJSHTMLInputElementDisabledSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
615 | { |
616 | UNUSED_PARAM(throwScope); |
617 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
618 | auto& impl = thisObject.wrapped(); |
619 | auto nativeValue = convert<IDLBoolean>(state, value); |
620 | RETURN_IF_EXCEPTION(throwScope, false); |
621 | AttributeSetter::call(state, throwScope, [&] { |
622 | return impl.setBooleanAttribute(WebCore::HTMLNames::disabledAttr, WTFMove(nativeValue)); |
623 | }); |
624 | return true; |
625 | } |
626 | |
627 | bool setJSHTMLInputElementDisabled(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
628 | { |
629 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementDisabledSetter>(*state, thisValue, encodedValue, "disabled" ); |
630 | } |
631 | |
632 | static inline JSValue jsHTMLInputElementFormGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
633 | { |
634 | UNUSED_PARAM(throwScope); |
635 | UNUSED_PARAM(state); |
636 | auto& impl = thisObject.wrapped(); |
637 | JSValue result = toJS<IDLInterface<HTMLFormElement>>(state, *thisObject.globalObject(), throwScope, impl.form()); |
638 | return result; |
639 | } |
640 | |
641 | EncodedJSValue jsHTMLInputElementForm(ExecState* state, EncodedJSValue thisValue, PropertyName) |
642 | { |
643 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementFormGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "form" ); |
644 | } |
645 | |
646 | static inline JSValue jsHTMLInputElementFilesGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
647 | { |
648 | UNUSED_PARAM(throwScope); |
649 | UNUSED_PARAM(state); |
650 | auto& impl = thisObject.wrapped(); |
651 | JSValue result = toJS<IDLNullable<IDLInterface<FileList>>>(state, *thisObject.globalObject(), throwScope, impl.files()); |
652 | return result; |
653 | } |
654 | |
655 | EncodedJSValue jsHTMLInputElementFiles(ExecState* state, EncodedJSValue thisValue, PropertyName) |
656 | { |
657 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementFilesGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "files" ); |
658 | } |
659 | |
660 | static inline bool setJSHTMLInputElementFilesSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
661 | { |
662 | UNUSED_PARAM(throwScope); |
663 | auto& impl = thisObject.wrapped(); |
664 | auto nativeValue = convert<IDLNullable<IDLInterface<FileList>>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "HTMLInputElement" , "files" , "FileList" ); }); |
665 | RETURN_IF_EXCEPTION(throwScope, false); |
666 | AttributeSetter::call(state, throwScope, [&] { |
667 | return impl.setFiles(WTFMove(nativeValue)); |
668 | }); |
669 | return true; |
670 | } |
671 | |
672 | bool setJSHTMLInputElementFiles(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
673 | { |
674 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementFilesSetter>(*state, thisValue, encodedValue, "files" ); |
675 | } |
676 | |
677 | static inline JSValue jsHTMLInputElementFormActionGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
678 | { |
679 | UNUSED_PARAM(throwScope); |
680 | UNUSED_PARAM(state); |
681 | auto& impl = thisObject.wrapped(); |
682 | JSValue result = toJS<IDLUSVString>(state, throwScope, impl.formAction()); |
683 | return result; |
684 | } |
685 | |
686 | EncodedJSValue jsHTMLInputElementFormAction(ExecState* state, EncodedJSValue thisValue, PropertyName) |
687 | { |
688 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementFormActionGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "formAction" ); |
689 | } |
690 | |
691 | static inline bool setJSHTMLInputElementFormActionSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
692 | { |
693 | UNUSED_PARAM(throwScope); |
694 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
695 | auto& impl = thisObject.wrapped(); |
696 | auto nativeValue = convert<IDLUSVString>(state, value); |
697 | RETURN_IF_EXCEPTION(throwScope, false); |
698 | AttributeSetter::call(state, throwScope, [&] { |
699 | return impl.setFormAction(WTFMove(nativeValue)); |
700 | }); |
701 | return true; |
702 | } |
703 | |
704 | bool setJSHTMLInputElementFormAction(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
705 | { |
706 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementFormActionSetter>(*state, thisValue, encodedValue, "formAction" ); |
707 | } |
708 | |
709 | static inline JSValue jsHTMLInputElementFormEnctypeGetter(ExecState& state, JSHTMLInputElement& 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.formEnctype()); |
715 | return result; |
716 | } |
717 | |
718 | EncodedJSValue jsHTMLInputElementFormEnctype(ExecState* state, EncodedJSValue thisValue, PropertyName) |
719 | { |
720 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementFormEnctypeGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "formEnctype" ); |
721 | } |
722 | |
723 | static inline bool setJSHTMLInputElementFormEnctypeSetter(ExecState& state, JSHTMLInputElement& 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.setFormEnctype(WTFMove(nativeValue)); |
732 | }); |
733 | return true; |
734 | } |
735 | |
736 | bool setJSHTMLInputElementFormEnctype(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
737 | { |
738 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementFormEnctypeSetter>(*state, thisValue, encodedValue, "formEnctype" ); |
739 | } |
740 | |
741 | static inline JSValue jsHTMLInputElementFormMethodGetter(ExecState& state, JSHTMLInputElement& 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.formMethod()); |
747 | return result; |
748 | } |
749 | |
750 | EncodedJSValue jsHTMLInputElementFormMethod(ExecState* state, EncodedJSValue thisValue, PropertyName) |
751 | { |
752 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementFormMethodGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "formMethod" ); |
753 | } |
754 | |
755 | static inline bool setJSHTMLInputElementFormMethodSetter(ExecState& state, JSHTMLInputElement& 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.setFormMethod(WTFMove(nativeValue)); |
764 | }); |
765 | return true; |
766 | } |
767 | |
768 | bool setJSHTMLInputElementFormMethod(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
769 | { |
770 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementFormMethodSetter>(*state, thisValue, encodedValue, "formMethod" ); |
771 | } |
772 | |
773 | static inline JSValue jsHTMLInputElementFormNoValidateGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
774 | { |
775 | UNUSED_PARAM(throwScope); |
776 | UNUSED_PARAM(state); |
777 | auto& impl = thisObject.wrapped(); |
778 | JSValue result = toJS<IDLBoolean>(state, throwScope, impl.hasAttributeWithoutSynchronization(WebCore::HTMLNames::formnovalidateAttr)); |
779 | return result; |
780 | } |
781 | |
782 | EncodedJSValue jsHTMLInputElementFormNoValidate(ExecState* state, EncodedJSValue thisValue, PropertyName) |
783 | { |
784 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementFormNoValidateGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "formNoValidate" ); |
785 | } |
786 | |
787 | static inline bool setJSHTMLInputElementFormNoValidateSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
788 | { |
789 | UNUSED_PARAM(throwScope); |
790 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
791 | auto& impl = thisObject.wrapped(); |
792 | auto nativeValue = convert<IDLBoolean>(state, value); |
793 | RETURN_IF_EXCEPTION(throwScope, false); |
794 | AttributeSetter::call(state, throwScope, [&] { |
795 | return impl.setBooleanAttribute(WebCore::HTMLNames::formnovalidateAttr, WTFMove(nativeValue)); |
796 | }); |
797 | return true; |
798 | } |
799 | |
800 | bool setJSHTMLInputElementFormNoValidate(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
801 | { |
802 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementFormNoValidateSetter>(*state, thisValue, encodedValue, "formNoValidate" ); |
803 | } |
804 | |
805 | static inline JSValue jsHTMLInputElementFormTargetGetter(ExecState& state, JSHTMLInputElement& 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::formtargetAttr)); |
811 | return result; |
812 | } |
813 | |
814 | EncodedJSValue jsHTMLInputElementFormTarget(ExecState* state, EncodedJSValue thisValue, PropertyName) |
815 | { |
816 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementFormTargetGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "formTarget" ); |
817 | } |
818 | |
819 | static inline bool setJSHTMLInputElementFormTargetSetter(ExecState& state, JSHTMLInputElement& 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::formtargetAttr, WTFMove(nativeValue)); |
828 | }); |
829 | return true; |
830 | } |
831 | |
832 | bool setJSHTMLInputElementFormTarget(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
833 | { |
834 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementFormTargetSetter>(*state, thisValue, encodedValue, "formTarget" ); |
835 | } |
836 | |
837 | static inline JSValue jsHTMLInputElementHeightGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
838 | { |
839 | UNUSED_PARAM(throwScope); |
840 | UNUSED_PARAM(state); |
841 | auto& impl = thisObject.wrapped(); |
842 | JSValue result = toJS<IDLUnsignedLong>(state, throwScope, impl.height()); |
843 | return result; |
844 | } |
845 | |
846 | EncodedJSValue jsHTMLInputElementHeight(ExecState* state, EncodedJSValue thisValue, PropertyName) |
847 | { |
848 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementHeightGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "height" ); |
849 | } |
850 | |
851 | static inline bool setJSHTMLInputElementHeightSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
852 | { |
853 | UNUSED_PARAM(throwScope); |
854 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
855 | auto& impl = thisObject.wrapped(); |
856 | auto nativeValue = convert<IDLUnsignedLong>(state, value); |
857 | RETURN_IF_EXCEPTION(throwScope, false); |
858 | AttributeSetter::call(state, throwScope, [&] { |
859 | return impl.setHeight(WTFMove(nativeValue)); |
860 | }); |
861 | return true; |
862 | } |
863 | |
864 | bool setJSHTMLInputElementHeight(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
865 | { |
866 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementHeightSetter>(*state, thisValue, encodedValue, "height" ); |
867 | } |
868 | |
869 | static inline JSValue jsHTMLInputElementIndeterminateGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
870 | { |
871 | UNUSED_PARAM(throwScope); |
872 | UNUSED_PARAM(state); |
873 | auto& impl = thisObject.wrapped(); |
874 | JSValue result = toJS<IDLBoolean>(state, throwScope, impl.indeterminate()); |
875 | return result; |
876 | } |
877 | |
878 | EncodedJSValue jsHTMLInputElementIndeterminate(ExecState* state, EncodedJSValue thisValue, PropertyName) |
879 | { |
880 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementIndeterminateGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "indeterminate" ); |
881 | } |
882 | |
883 | static inline bool setJSHTMLInputElementIndeterminateSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
884 | { |
885 | UNUSED_PARAM(throwScope); |
886 | auto& impl = thisObject.wrapped(); |
887 | auto nativeValue = convert<IDLBoolean>(state, value); |
888 | RETURN_IF_EXCEPTION(throwScope, false); |
889 | AttributeSetter::call(state, throwScope, [&] { |
890 | return impl.setIndeterminate(WTFMove(nativeValue)); |
891 | }); |
892 | return true; |
893 | } |
894 | |
895 | bool setJSHTMLInputElementIndeterminate(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
896 | { |
897 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementIndeterminateSetter>(*state, thisValue, encodedValue, "indeterminate" ); |
898 | } |
899 | |
900 | #if ENABLE(DATALIST_ELEMENT) |
901 | static inline JSValue jsHTMLInputElementListGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
902 | { |
903 | UNUSED_PARAM(throwScope); |
904 | UNUSED_PARAM(state); |
905 | auto& impl = thisObject.wrapped(); |
906 | JSValue result = toJS<IDLInterface<HTMLElement>>(state, *thisObject.globalObject(), throwScope, impl.list()); |
907 | return result; |
908 | } |
909 | |
910 | EncodedJSValue jsHTMLInputElementList(ExecState* state, EncodedJSValue thisValue, PropertyName) |
911 | { |
912 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementListGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "list" ); |
913 | } |
914 | |
915 | #endif |
916 | |
917 | static inline JSValue jsHTMLInputElementMaxGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
918 | { |
919 | UNUSED_PARAM(throwScope); |
920 | UNUSED_PARAM(state); |
921 | auto& impl = thisObject.wrapped(); |
922 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::maxAttr)); |
923 | return result; |
924 | } |
925 | |
926 | EncodedJSValue jsHTMLInputElementMax(ExecState* state, EncodedJSValue thisValue, PropertyName) |
927 | { |
928 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementMaxGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "max" ); |
929 | } |
930 | |
931 | static inline bool setJSHTMLInputElementMaxSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
932 | { |
933 | UNUSED_PARAM(throwScope); |
934 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
935 | auto& impl = thisObject.wrapped(); |
936 | auto nativeValue = convert<IDLDOMString>(state, value); |
937 | RETURN_IF_EXCEPTION(throwScope, false); |
938 | AttributeSetter::call(state, throwScope, [&] { |
939 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::maxAttr, WTFMove(nativeValue)); |
940 | }); |
941 | return true; |
942 | } |
943 | |
944 | bool setJSHTMLInputElementMax(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
945 | { |
946 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementMaxSetter>(*state, thisValue, encodedValue, "max" ); |
947 | } |
948 | |
949 | static inline JSValue jsHTMLInputElementMinLengthGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
950 | { |
951 | UNUSED_PARAM(throwScope); |
952 | UNUSED_PARAM(state); |
953 | auto& impl = thisObject.wrapped(); |
954 | JSValue result = toJS<IDLLong>(state, throwScope, impl.minLength()); |
955 | return result; |
956 | } |
957 | |
958 | EncodedJSValue jsHTMLInputElementMinLength(ExecState* state, EncodedJSValue thisValue, PropertyName) |
959 | { |
960 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementMinLengthGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "minLength" ); |
961 | } |
962 | |
963 | static inline bool setJSHTMLInputElementMinLengthSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
964 | { |
965 | UNUSED_PARAM(throwScope); |
966 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
967 | auto& impl = thisObject.wrapped(); |
968 | auto nativeValue = convert<IDLLong>(state, value); |
969 | RETURN_IF_EXCEPTION(throwScope, false); |
970 | AttributeSetter::call(state, throwScope, [&] { |
971 | return impl.setMinLength(WTFMove(nativeValue)); |
972 | }); |
973 | return true; |
974 | } |
975 | |
976 | bool setJSHTMLInputElementMinLength(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
977 | { |
978 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementMinLengthSetter>(*state, thisValue, encodedValue, "minLength" ); |
979 | } |
980 | |
981 | static inline JSValue jsHTMLInputElementMaxLengthGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
982 | { |
983 | UNUSED_PARAM(throwScope); |
984 | UNUSED_PARAM(state); |
985 | auto& impl = thisObject.wrapped(); |
986 | JSValue result = toJS<IDLLong>(state, throwScope, impl.maxLength()); |
987 | return result; |
988 | } |
989 | |
990 | EncodedJSValue jsHTMLInputElementMaxLength(ExecState* state, EncodedJSValue thisValue, PropertyName) |
991 | { |
992 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementMaxLengthGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "maxLength" ); |
993 | } |
994 | |
995 | static inline bool setJSHTMLInputElementMaxLengthSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
996 | { |
997 | UNUSED_PARAM(throwScope); |
998 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
999 | auto& impl = thisObject.wrapped(); |
1000 | auto nativeValue = convert<IDLLong>(state, value); |
1001 | RETURN_IF_EXCEPTION(throwScope, false); |
1002 | AttributeSetter::call(state, throwScope, [&] { |
1003 | return impl.setMaxLength(WTFMove(nativeValue)); |
1004 | }); |
1005 | return true; |
1006 | } |
1007 | |
1008 | bool setJSHTMLInputElementMaxLength(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1009 | { |
1010 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementMaxLengthSetter>(*state, thisValue, encodedValue, "maxLength" ); |
1011 | } |
1012 | |
1013 | static inline JSValue jsHTMLInputElementMinGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1014 | { |
1015 | UNUSED_PARAM(throwScope); |
1016 | UNUSED_PARAM(state); |
1017 | auto& impl = thisObject.wrapped(); |
1018 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::minAttr)); |
1019 | return result; |
1020 | } |
1021 | |
1022 | EncodedJSValue jsHTMLInputElementMin(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1023 | { |
1024 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementMinGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "min" ); |
1025 | } |
1026 | |
1027 | static inline bool setJSHTMLInputElementMinSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
1028 | { |
1029 | UNUSED_PARAM(throwScope); |
1030 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
1031 | auto& impl = thisObject.wrapped(); |
1032 | auto nativeValue = convert<IDLDOMString>(state, value); |
1033 | RETURN_IF_EXCEPTION(throwScope, false); |
1034 | AttributeSetter::call(state, throwScope, [&] { |
1035 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::minAttr, WTFMove(nativeValue)); |
1036 | }); |
1037 | return true; |
1038 | } |
1039 | |
1040 | bool setJSHTMLInputElementMin(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1041 | { |
1042 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementMinSetter>(*state, thisValue, encodedValue, "min" ); |
1043 | } |
1044 | |
1045 | static inline JSValue jsHTMLInputElementMultipleGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1046 | { |
1047 | UNUSED_PARAM(throwScope); |
1048 | UNUSED_PARAM(state); |
1049 | auto& impl = thisObject.wrapped(); |
1050 | JSValue result = toJS<IDLBoolean>(state, throwScope, impl.hasAttributeWithoutSynchronization(WebCore::HTMLNames::multipleAttr)); |
1051 | return result; |
1052 | } |
1053 | |
1054 | EncodedJSValue jsHTMLInputElementMultiple(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1055 | { |
1056 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementMultipleGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "multiple" ); |
1057 | } |
1058 | |
1059 | static inline bool setJSHTMLInputElementMultipleSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
1060 | { |
1061 | UNUSED_PARAM(throwScope); |
1062 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
1063 | auto& impl = thisObject.wrapped(); |
1064 | auto nativeValue = convert<IDLBoolean>(state, value); |
1065 | RETURN_IF_EXCEPTION(throwScope, false); |
1066 | AttributeSetter::call(state, throwScope, [&] { |
1067 | return impl.setBooleanAttribute(WebCore::HTMLNames::multipleAttr, WTFMove(nativeValue)); |
1068 | }); |
1069 | return true; |
1070 | } |
1071 | |
1072 | bool setJSHTMLInputElementMultiple(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1073 | { |
1074 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementMultipleSetter>(*state, thisValue, encodedValue, "multiple" ); |
1075 | } |
1076 | |
1077 | static inline JSValue jsHTMLInputElementNameGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1078 | { |
1079 | UNUSED_PARAM(throwScope); |
1080 | UNUSED_PARAM(state); |
1081 | auto& impl = thisObject.wrapped(); |
1082 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.getNameAttribute()); |
1083 | return result; |
1084 | } |
1085 | |
1086 | EncodedJSValue jsHTMLInputElementName(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1087 | { |
1088 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementNameGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "name" ); |
1089 | } |
1090 | |
1091 | static inline bool setJSHTMLInputElementNameSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
1092 | { |
1093 | UNUSED_PARAM(throwScope); |
1094 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
1095 | auto& impl = thisObject.wrapped(); |
1096 | auto nativeValue = convert<IDLDOMString>(state, value); |
1097 | RETURN_IF_EXCEPTION(throwScope, false); |
1098 | AttributeSetter::call(state, throwScope, [&] { |
1099 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::nameAttr, WTFMove(nativeValue)); |
1100 | }); |
1101 | return true; |
1102 | } |
1103 | |
1104 | bool setJSHTMLInputElementName(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1105 | { |
1106 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementNameSetter>(*state, thisValue, encodedValue, "name" ); |
1107 | } |
1108 | |
1109 | static inline JSValue jsHTMLInputElementPatternGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1110 | { |
1111 | UNUSED_PARAM(throwScope); |
1112 | UNUSED_PARAM(state); |
1113 | auto& impl = thisObject.wrapped(); |
1114 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::patternAttr)); |
1115 | return result; |
1116 | } |
1117 | |
1118 | EncodedJSValue jsHTMLInputElementPattern(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1119 | { |
1120 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementPatternGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "pattern" ); |
1121 | } |
1122 | |
1123 | static inline bool setJSHTMLInputElementPatternSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
1124 | { |
1125 | UNUSED_PARAM(throwScope); |
1126 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
1127 | auto& impl = thisObject.wrapped(); |
1128 | auto nativeValue = convert<IDLDOMString>(state, value); |
1129 | RETURN_IF_EXCEPTION(throwScope, false); |
1130 | AttributeSetter::call(state, throwScope, [&] { |
1131 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::patternAttr, WTFMove(nativeValue)); |
1132 | }); |
1133 | return true; |
1134 | } |
1135 | |
1136 | bool setJSHTMLInputElementPattern(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1137 | { |
1138 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementPatternSetter>(*state, thisValue, encodedValue, "pattern" ); |
1139 | } |
1140 | |
1141 | static inline JSValue jsHTMLInputElementPlaceholderGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1142 | { |
1143 | UNUSED_PARAM(throwScope); |
1144 | UNUSED_PARAM(state); |
1145 | auto& impl = thisObject.wrapped(); |
1146 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::placeholderAttr)); |
1147 | return result; |
1148 | } |
1149 | |
1150 | EncodedJSValue jsHTMLInputElementPlaceholder(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1151 | { |
1152 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementPlaceholderGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "placeholder" ); |
1153 | } |
1154 | |
1155 | static inline bool setJSHTMLInputElementPlaceholderSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
1156 | { |
1157 | UNUSED_PARAM(throwScope); |
1158 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
1159 | auto& impl = thisObject.wrapped(); |
1160 | auto nativeValue = convert<IDLDOMString>(state, value); |
1161 | RETURN_IF_EXCEPTION(throwScope, false); |
1162 | AttributeSetter::call(state, throwScope, [&] { |
1163 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::placeholderAttr, WTFMove(nativeValue)); |
1164 | }); |
1165 | return true; |
1166 | } |
1167 | |
1168 | bool setJSHTMLInputElementPlaceholder(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1169 | { |
1170 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementPlaceholderSetter>(*state, thisValue, encodedValue, "placeholder" ); |
1171 | } |
1172 | |
1173 | static inline JSValue jsHTMLInputElementReadOnlyGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1174 | { |
1175 | UNUSED_PARAM(throwScope); |
1176 | UNUSED_PARAM(state); |
1177 | auto& impl = thisObject.wrapped(); |
1178 | JSValue result = toJS<IDLBoolean>(state, throwScope, impl.hasAttributeWithoutSynchronization(WebCore::HTMLNames::readonlyAttr)); |
1179 | return result; |
1180 | } |
1181 | |
1182 | EncodedJSValue jsHTMLInputElementReadOnly(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1183 | { |
1184 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementReadOnlyGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "readOnly" ); |
1185 | } |
1186 | |
1187 | static inline bool setJSHTMLInputElementReadOnlySetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
1188 | { |
1189 | UNUSED_PARAM(throwScope); |
1190 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
1191 | auto& impl = thisObject.wrapped(); |
1192 | auto nativeValue = convert<IDLBoolean>(state, value); |
1193 | RETURN_IF_EXCEPTION(throwScope, false); |
1194 | AttributeSetter::call(state, throwScope, [&] { |
1195 | return impl.setBooleanAttribute(WebCore::HTMLNames::readonlyAttr, WTFMove(nativeValue)); |
1196 | }); |
1197 | return true; |
1198 | } |
1199 | |
1200 | bool setJSHTMLInputElementReadOnly(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1201 | { |
1202 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementReadOnlySetter>(*state, thisValue, encodedValue, "readOnly" ); |
1203 | } |
1204 | |
1205 | static inline JSValue jsHTMLInputElementRequiredGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1206 | { |
1207 | UNUSED_PARAM(throwScope); |
1208 | UNUSED_PARAM(state); |
1209 | auto& impl = thisObject.wrapped(); |
1210 | JSValue result = toJS<IDLBoolean>(state, throwScope, impl.hasAttributeWithoutSynchronization(WebCore::HTMLNames::requiredAttr)); |
1211 | return result; |
1212 | } |
1213 | |
1214 | EncodedJSValue jsHTMLInputElementRequired(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1215 | { |
1216 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementRequiredGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "required" ); |
1217 | } |
1218 | |
1219 | static inline bool setJSHTMLInputElementRequiredSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
1220 | { |
1221 | UNUSED_PARAM(throwScope); |
1222 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
1223 | auto& impl = thisObject.wrapped(); |
1224 | auto nativeValue = convert<IDLBoolean>(state, value); |
1225 | RETURN_IF_EXCEPTION(throwScope, false); |
1226 | AttributeSetter::call(state, throwScope, [&] { |
1227 | return impl.setBooleanAttribute(WebCore::HTMLNames::requiredAttr, WTFMove(nativeValue)); |
1228 | }); |
1229 | return true; |
1230 | } |
1231 | |
1232 | bool setJSHTMLInputElementRequired(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1233 | { |
1234 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementRequiredSetter>(*state, thisValue, encodedValue, "required" ); |
1235 | } |
1236 | |
1237 | static inline JSValue jsHTMLInputElementSizeGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1238 | { |
1239 | UNUSED_PARAM(throwScope); |
1240 | UNUSED_PARAM(state); |
1241 | auto& impl = thisObject.wrapped(); |
1242 | JSValue result = toJS<IDLUnsignedLong>(state, throwScope, impl.size()); |
1243 | return result; |
1244 | } |
1245 | |
1246 | EncodedJSValue jsHTMLInputElementSize(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1247 | { |
1248 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementSizeGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "size" ); |
1249 | } |
1250 | |
1251 | static inline bool setJSHTMLInputElementSizeSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
1252 | { |
1253 | UNUSED_PARAM(throwScope); |
1254 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
1255 | auto& impl = thisObject.wrapped(); |
1256 | auto nativeValue = convert<IDLUnsignedLong>(state, value); |
1257 | RETURN_IF_EXCEPTION(throwScope, false); |
1258 | AttributeSetter::call(state, throwScope, [&] { |
1259 | return impl.setSize(WTFMove(nativeValue)); |
1260 | }); |
1261 | return true; |
1262 | } |
1263 | |
1264 | bool setJSHTMLInputElementSize(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1265 | { |
1266 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementSizeSetter>(*state, thisValue, encodedValue, "size" ); |
1267 | } |
1268 | |
1269 | static inline JSValue jsHTMLInputElementSrcGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1270 | { |
1271 | UNUSED_PARAM(throwScope); |
1272 | UNUSED_PARAM(state); |
1273 | auto& impl = thisObject.wrapped(); |
1274 | JSValue result = toJS<IDLUSVString>(state, throwScope, impl.getURLAttribute(WebCore::HTMLNames::srcAttr)); |
1275 | return result; |
1276 | } |
1277 | |
1278 | EncodedJSValue jsHTMLInputElementSrc(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1279 | { |
1280 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementSrcGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "src" ); |
1281 | } |
1282 | |
1283 | static inline bool setJSHTMLInputElementSrcSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
1284 | { |
1285 | UNUSED_PARAM(throwScope); |
1286 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
1287 | auto& impl = thisObject.wrapped(); |
1288 | auto nativeValue = convert<IDLUSVString>(state, value); |
1289 | RETURN_IF_EXCEPTION(throwScope, false); |
1290 | AttributeSetter::call(state, throwScope, [&] { |
1291 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::srcAttr, WTFMove(nativeValue)); |
1292 | }); |
1293 | return true; |
1294 | } |
1295 | |
1296 | bool setJSHTMLInputElementSrc(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1297 | { |
1298 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementSrcSetter>(*state, thisValue, encodedValue, "src" ); |
1299 | } |
1300 | |
1301 | static inline JSValue jsHTMLInputElementStepGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1302 | { |
1303 | UNUSED_PARAM(throwScope); |
1304 | UNUSED_PARAM(state); |
1305 | auto& impl = thisObject.wrapped(); |
1306 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::stepAttr)); |
1307 | return result; |
1308 | } |
1309 | |
1310 | EncodedJSValue jsHTMLInputElementStep(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1311 | { |
1312 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementStepGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "step" ); |
1313 | } |
1314 | |
1315 | static inline bool setJSHTMLInputElementStepSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
1316 | { |
1317 | UNUSED_PARAM(throwScope); |
1318 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
1319 | auto& impl = thisObject.wrapped(); |
1320 | auto nativeValue = convert<IDLDOMString>(state, value); |
1321 | RETURN_IF_EXCEPTION(throwScope, false); |
1322 | AttributeSetter::call(state, throwScope, [&] { |
1323 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::stepAttr, WTFMove(nativeValue)); |
1324 | }); |
1325 | return true; |
1326 | } |
1327 | |
1328 | bool setJSHTMLInputElementStep(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1329 | { |
1330 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementStepSetter>(*state, thisValue, encodedValue, "step" ); |
1331 | } |
1332 | |
1333 | static inline JSValue jsHTMLInputElementTypeGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1334 | { |
1335 | UNUSED_PARAM(throwScope); |
1336 | UNUSED_PARAM(state); |
1337 | auto& impl = thisObject.wrapped(); |
1338 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.type()); |
1339 | return result; |
1340 | } |
1341 | |
1342 | EncodedJSValue jsHTMLInputElementType(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1343 | { |
1344 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementTypeGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "type" ); |
1345 | } |
1346 | |
1347 | static inline bool setJSHTMLInputElementTypeSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
1348 | { |
1349 | UNUSED_PARAM(throwScope); |
1350 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
1351 | auto& impl = thisObject.wrapped(); |
1352 | auto nativeValue = convert<IDLDOMString>(state, value); |
1353 | RETURN_IF_EXCEPTION(throwScope, false); |
1354 | AttributeSetter::call(state, throwScope, [&] { |
1355 | return impl.setType(WTFMove(nativeValue)); |
1356 | }); |
1357 | return true; |
1358 | } |
1359 | |
1360 | bool setJSHTMLInputElementType(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1361 | { |
1362 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementTypeSetter>(*state, thisValue, encodedValue, "type" ); |
1363 | } |
1364 | |
1365 | static inline JSValue jsHTMLInputElementDefaultValueGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1366 | { |
1367 | UNUSED_PARAM(throwScope); |
1368 | UNUSED_PARAM(state); |
1369 | auto& impl = thisObject.wrapped(); |
1370 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.defaultValue()); |
1371 | return result; |
1372 | } |
1373 | |
1374 | EncodedJSValue jsHTMLInputElementDefaultValue(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1375 | { |
1376 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementDefaultValueGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "defaultValue" ); |
1377 | } |
1378 | |
1379 | static inline bool setJSHTMLInputElementDefaultValueSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
1380 | { |
1381 | UNUSED_PARAM(throwScope); |
1382 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
1383 | auto& impl = thisObject.wrapped(); |
1384 | auto nativeValue = convert<IDLDOMString>(state, value); |
1385 | RETURN_IF_EXCEPTION(throwScope, false); |
1386 | AttributeSetter::call(state, throwScope, [&] { |
1387 | return impl.setDefaultValue(WTFMove(nativeValue)); |
1388 | }); |
1389 | return true; |
1390 | } |
1391 | |
1392 | bool setJSHTMLInputElementDefaultValue(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1393 | { |
1394 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementDefaultValueSetter>(*state, thisValue, encodedValue, "defaultValue" ); |
1395 | } |
1396 | |
1397 | static inline JSValue jsHTMLInputElementValueGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1398 | { |
1399 | UNUSED_PARAM(throwScope); |
1400 | UNUSED_PARAM(state); |
1401 | auto& impl = thisObject.wrapped(); |
1402 | JSValue result = toJS<IDLTreatNullAsEmptyAdaptor<IDLDOMString>>(state, throwScope, impl.value()); |
1403 | return result; |
1404 | } |
1405 | |
1406 | EncodedJSValue jsHTMLInputElementValue(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1407 | { |
1408 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementValueGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "value" ); |
1409 | } |
1410 | |
1411 | static inline bool setJSHTMLInputElementValueSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
1412 | { |
1413 | UNUSED_PARAM(throwScope); |
1414 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
1415 | auto& impl = thisObject.wrapped(); |
1416 | auto nativeValue = convert<IDLTreatNullAsEmptyAdaptor<IDLDOMString>>(state, value); |
1417 | RETURN_IF_EXCEPTION(throwScope, false); |
1418 | AttributeSetter::call(state, throwScope, [&] { |
1419 | return impl.setValue(WTFMove(nativeValue)); |
1420 | }); |
1421 | return true; |
1422 | } |
1423 | |
1424 | bool setJSHTMLInputElementValue(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1425 | { |
1426 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementValueSetter>(*state, thisValue, encodedValue, "value" ); |
1427 | } |
1428 | |
1429 | static inline JSValue jsHTMLInputElementValueAsDateGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1430 | { |
1431 | UNUSED_PARAM(throwScope); |
1432 | UNUSED_PARAM(state); |
1433 | auto& impl = thisObject.wrapped(); |
1434 | JSValue result = toJS<IDLNullable<IDLDate>>(state, throwScope, impl.valueAsDate()); |
1435 | return result; |
1436 | } |
1437 | |
1438 | EncodedJSValue jsHTMLInputElementValueAsDate(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1439 | { |
1440 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementValueAsDateGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "valueAsDate" ); |
1441 | } |
1442 | |
1443 | static inline bool setJSHTMLInputElementValueAsDateSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
1444 | { |
1445 | UNUSED_PARAM(throwScope); |
1446 | auto& impl = thisObject.wrapped(); |
1447 | auto nativeValue = convert<IDLNullable<IDLDate>>(state, value); |
1448 | RETURN_IF_EXCEPTION(throwScope, false); |
1449 | AttributeSetter::call(state, throwScope, [&] { |
1450 | return impl.setValueAsDate(WTFMove(nativeValue)); |
1451 | }); |
1452 | return true; |
1453 | } |
1454 | |
1455 | bool setJSHTMLInputElementValueAsDate(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1456 | { |
1457 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementValueAsDateSetter>(*state, thisValue, encodedValue, "valueAsDate" ); |
1458 | } |
1459 | |
1460 | static inline JSValue jsHTMLInputElementValueAsNumberGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1461 | { |
1462 | UNUSED_PARAM(throwScope); |
1463 | UNUSED_PARAM(state); |
1464 | auto& impl = thisObject.wrapped(); |
1465 | JSValue result = toJS<IDLUnrestrictedDouble>(state, throwScope, impl.valueAsNumber()); |
1466 | return result; |
1467 | } |
1468 | |
1469 | EncodedJSValue jsHTMLInputElementValueAsNumber(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1470 | { |
1471 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementValueAsNumberGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "valueAsNumber" ); |
1472 | } |
1473 | |
1474 | static inline bool setJSHTMLInputElementValueAsNumberSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
1475 | { |
1476 | UNUSED_PARAM(throwScope); |
1477 | auto& impl = thisObject.wrapped(); |
1478 | auto nativeValue = convert<IDLUnrestrictedDouble>(state, value); |
1479 | RETURN_IF_EXCEPTION(throwScope, false); |
1480 | AttributeSetter::call(state, throwScope, [&] { |
1481 | return impl.setValueAsNumber(WTFMove(nativeValue)); |
1482 | }); |
1483 | return true; |
1484 | } |
1485 | |
1486 | bool setJSHTMLInputElementValueAsNumber(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1487 | { |
1488 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementValueAsNumberSetter>(*state, thisValue, encodedValue, "valueAsNumber" ); |
1489 | } |
1490 | |
1491 | static inline JSValue jsHTMLInputElementWidthGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1492 | { |
1493 | UNUSED_PARAM(throwScope); |
1494 | UNUSED_PARAM(state); |
1495 | auto& impl = thisObject.wrapped(); |
1496 | JSValue result = toJS<IDLUnsignedLong>(state, throwScope, impl.width()); |
1497 | return result; |
1498 | } |
1499 | |
1500 | EncodedJSValue jsHTMLInputElementWidth(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1501 | { |
1502 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementWidthGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "width" ); |
1503 | } |
1504 | |
1505 | static inline bool setJSHTMLInputElementWidthSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
1506 | { |
1507 | UNUSED_PARAM(throwScope); |
1508 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
1509 | auto& impl = thisObject.wrapped(); |
1510 | auto nativeValue = convert<IDLUnsignedLong>(state, value); |
1511 | RETURN_IF_EXCEPTION(throwScope, false); |
1512 | AttributeSetter::call(state, throwScope, [&] { |
1513 | return impl.setWidth(WTFMove(nativeValue)); |
1514 | }); |
1515 | return true; |
1516 | } |
1517 | |
1518 | bool setJSHTMLInputElementWidth(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1519 | { |
1520 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementWidthSetter>(*state, thisValue, encodedValue, "width" ); |
1521 | } |
1522 | |
1523 | static inline JSValue jsHTMLInputElementWillValidateGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1524 | { |
1525 | UNUSED_PARAM(throwScope); |
1526 | UNUSED_PARAM(state); |
1527 | auto& impl = thisObject.wrapped(); |
1528 | JSValue result = toJS<IDLBoolean>(state, throwScope, impl.willValidate()); |
1529 | return result; |
1530 | } |
1531 | |
1532 | EncodedJSValue jsHTMLInputElementWillValidate(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1533 | { |
1534 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementWillValidateGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "willValidate" ); |
1535 | } |
1536 | |
1537 | static inline JSValue jsHTMLInputElementValidityGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1538 | { |
1539 | UNUSED_PARAM(throwScope); |
1540 | UNUSED_PARAM(state); |
1541 | auto& impl = thisObject.wrapped(); |
1542 | JSValue result = toJS<IDLInterface<ValidityState>>(state, *thisObject.globalObject(), throwScope, impl.validity()); |
1543 | return result; |
1544 | } |
1545 | |
1546 | EncodedJSValue jsHTMLInputElementValidity(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1547 | { |
1548 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementValidityGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "validity" ); |
1549 | } |
1550 | |
1551 | static inline JSValue jsHTMLInputElementValidationMessageGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1552 | { |
1553 | UNUSED_PARAM(throwScope); |
1554 | UNUSED_PARAM(state); |
1555 | auto& impl = thisObject.wrapped(); |
1556 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.validationMessage()); |
1557 | return result; |
1558 | } |
1559 | |
1560 | EncodedJSValue jsHTMLInputElementValidationMessage(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1561 | { |
1562 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementValidationMessageGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "validationMessage" ); |
1563 | } |
1564 | |
1565 | static inline JSValue jsHTMLInputElementLabelsGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1566 | { |
1567 | UNUSED_PARAM(throwScope); |
1568 | UNUSED_PARAM(state); |
1569 | auto& impl = thisObject.wrapped(); |
1570 | JSValue result = toJS<IDLInterface<NodeList>>(state, *thisObject.globalObject(), throwScope, impl.labels()); |
1571 | return result; |
1572 | } |
1573 | |
1574 | EncodedJSValue jsHTMLInputElementLabels(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1575 | { |
1576 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementLabelsGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "labels" ); |
1577 | } |
1578 | |
1579 | static inline JSValue jsHTMLInputElementSelectionStartGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1580 | { |
1581 | UNUSED_PARAM(throwScope); |
1582 | UNUSED_PARAM(state); |
1583 | auto& impl = thisObject.wrapped(); |
1584 | JSValue result = toJS<IDLLong>(state, throwScope, impl.selectionStartForBindings()); |
1585 | return result; |
1586 | } |
1587 | |
1588 | EncodedJSValue jsHTMLInputElementSelectionStart(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1589 | { |
1590 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementSelectionStartGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "selectionStart" ); |
1591 | } |
1592 | |
1593 | static inline bool setJSHTMLInputElementSelectionStartSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
1594 | { |
1595 | UNUSED_PARAM(throwScope); |
1596 | auto& impl = thisObject.wrapped(); |
1597 | auto nativeValue = convert<IDLLong>(state, value); |
1598 | RETURN_IF_EXCEPTION(throwScope, false); |
1599 | AttributeSetter::call(state, throwScope, [&] { |
1600 | return impl.setSelectionStartForBindings(WTFMove(nativeValue)); |
1601 | }); |
1602 | return true; |
1603 | } |
1604 | |
1605 | bool setJSHTMLInputElementSelectionStart(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1606 | { |
1607 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementSelectionStartSetter>(*state, thisValue, encodedValue, "selectionStart" ); |
1608 | } |
1609 | |
1610 | static inline JSValue jsHTMLInputElementSelectionEndGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1611 | { |
1612 | UNUSED_PARAM(throwScope); |
1613 | UNUSED_PARAM(state); |
1614 | auto& impl = thisObject.wrapped(); |
1615 | JSValue result = toJS<IDLLong>(state, throwScope, impl.selectionEndForBindings()); |
1616 | return result; |
1617 | } |
1618 | |
1619 | EncodedJSValue jsHTMLInputElementSelectionEnd(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1620 | { |
1621 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementSelectionEndGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "selectionEnd" ); |
1622 | } |
1623 | |
1624 | static inline bool setJSHTMLInputElementSelectionEndSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
1625 | { |
1626 | UNUSED_PARAM(throwScope); |
1627 | auto& impl = thisObject.wrapped(); |
1628 | auto nativeValue = convert<IDLLong>(state, value); |
1629 | RETURN_IF_EXCEPTION(throwScope, false); |
1630 | AttributeSetter::call(state, throwScope, [&] { |
1631 | return impl.setSelectionEndForBindings(WTFMove(nativeValue)); |
1632 | }); |
1633 | return true; |
1634 | } |
1635 | |
1636 | bool setJSHTMLInputElementSelectionEnd(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1637 | { |
1638 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementSelectionEndSetter>(*state, thisValue, encodedValue, "selectionEnd" ); |
1639 | } |
1640 | |
1641 | static inline JSValue jsHTMLInputElementSelectionDirectionGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1642 | { |
1643 | UNUSED_PARAM(throwScope); |
1644 | UNUSED_PARAM(state); |
1645 | auto& impl = thisObject.wrapped(); |
1646 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.selectionDirectionForBindings()); |
1647 | return result; |
1648 | } |
1649 | |
1650 | EncodedJSValue jsHTMLInputElementSelectionDirection(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1651 | { |
1652 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementSelectionDirectionGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "selectionDirection" ); |
1653 | } |
1654 | |
1655 | static inline bool setJSHTMLInputElementSelectionDirectionSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
1656 | { |
1657 | UNUSED_PARAM(throwScope); |
1658 | auto& impl = thisObject.wrapped(); |
1659 | auto nativeValue = convert<IDLDOMString>(state, value); |
1660 | RETURN_IF_EXCEPTION(throwScope, false); |
1661 | AttributeSetter::call(state, throwScope, [&] { |
1662 | return impl.setSelectionDirectionForBindings(WTFMove(nativeValue)); |
1663 | }); |
1664 | return true; |
1665 | } |
1666 | |
1667 | bool setJSHTMLInputElementSelectionDirection(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1668 | { |
1669 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementSelectionDirectionSetter>(*state, thisValue, encodedValue, "selectionDirection" ); |
1670 | } |
1671 | |
1672 | static inline JSValue jsHTMLInputElementAlignGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1673 | { |
1674 | UNUSED_PARAM(throwScope); |
1675 | UNUSED_PARAM(state); |
1676 | auto& impl = thisObject.wrapped(); |
1677 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::alignAttr)); |
1678 | return result; |
1679 | } |
1680 | |
1681 | EncodedJSValue jsHTMLInputElementAlign(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1682 | { |
1683 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementAlignGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "align" ); |
1684 | } |
1685 | |
1686 | static inline bool setJSHTMLInputElementAlignSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
1687 | { |
1688 | UNUSED_PARAM(throwScope); |
1689 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
1690 | auto& impl = thisObject.wrapped(); |
1691 | auto nativeValue = convert<IDLDOMString>(state, value); |
1692 | RETURN_IF_EXCEPTION(throwScope, false); |
1693 | AttributeSetter::call(state, throwScope, [&] { |
1694 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::alignAttr, WTFMove(nativeValue)); |
1695 | }); |
1696 | return true; |
1697 | } |
1698 | |
1699 | bool setJSHTMLInputElementAlign(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1700 | { |
1701 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementAlignSetter>(*state, thisValue, encodedValue, "align" ); |
1702 | } |
1703 | |
1704 | static inline JSValue jsHTMLInputElementUseMapGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1705 | { |
1706 | UNUSED_PARAM(throwScope); |
1707 | UNUSED_PARAM(state); |
1708 | auto& impl = thisObject.wrapped(); |
1709 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::usemapAttr)); |
1710 | return result; |
1711 | } |
1712 | |
1713 | EncodedJSValue jsHTMLInputElementUseMap(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1714 | { |
1715 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementUseMapGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "useMap" ); |
1716 | } |
1717 | |
1718 | static inline bool setJSHTMLInputElementUseMapSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
1719 | { |
1720 | UNUSED_PARAM(throwScope); |
1721 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
1722 | auto& impl = thisObject.wrapped(); |
1723 | auto nativeValue = convert<IDLDOMString>(state, value); |
1724 | RETURN_IF_EXCEPTION(throwScope, false); |
1725 | AttributeSetter::call(state, throwScope, [&] { |
1726 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::usemapAttr, WTFMove(nativeValue)); |
1727 | }); |
1728 | return true; |
1729 | } |
1730 | |
1731 | bool setJSHTMLInputElementUseMap(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1732 | { |
1733 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementUseMapSetter>(*state, thisValue, encodedValue, "useMap" ); |
1734 | } |
1735 | |
1736 | static inline JSValue jsHTMLInputElementIncrementalGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1737 | { |
1738 | UNUSED_PARAM(throwScope); |
1739 | UNUSED_PARAM(state); |
1740 | auto& impl = thisObject.wrapped(); |
1741 | JSValue result = toJS<IDLBoolean>(state, throwScope, impl.hasAttributeWithoutSynchronization(WebCore::HTMLNames::incrementalAttr)); |
1742 | return result; |
1743 | } |
1744 | |
1745 | EncodedJSValue jsHTMLInputElementIncremental(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1746 | { |
1747 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementIncrementalGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "incremental" ); |
1748 | } |
1749 | |
1750 | static inline bool setJSHTMLInputElementIncrementalSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
1751 | { |
1752 | UNUSED_PARAM(throwScope); |
1753 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
1754 | auto& impl = thisObject.wrapped(); |
1755 | auto nativeValue = convert<IDLBoolean>(state, value); |
1756 | RETURN_IF_EXCEPTION(throwScope, false); |
1757 | AttributeSetter::call(state, throwScope, [&] { |
1758 | return impl.setBooleanAttribute(WebCore::HTMLNames::incrementalAttr, WTFMove(nativeValue)); |
1759 | }); |
1760 | return true; |
1761 | } |
1762 | |
1763 | bool setJSHTMLInputElementIncremental(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1764 | { |
1765 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementIncrementalSetter>(*state, thisValue, encodedValue, "incremental" ); |
1766 | } |
1767 | |
1768 | #if ENABLE(MEDIA_CAPTURE) |
1769 | static inline JSValue jsHTMLInputElementCaptureGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1770 | { |
1771 | UNUSED_PARAM(throwScope); |
1772 | UNUSED_PARAM(state); |
1773 | auto& impl = thisObject.wrapped(); |
1774 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::captureAttr)); |
1775 | return result; |
1776 | } |
1777 | |
1778 | EncodedJSValue jsHTMLInputElementCapture(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1779 | { |
1780 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementCaptureGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "capture" ); |
1781 | } |
1782 | |
1783 | #endif |
1784 | |
1785 | #if ENABLE(MEDIA_CAPTURE) |
1786 | static inline bool setJSHTMLInputElementCaptureSetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
1787 | { |
1788 | UNUSED_PARAM(throwScope); |
1789 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
1790 | auto& impl = thisObject.wrapped(); |
1791 | auto nativeValue = convert<IDLDOMString>(state, value); |
1792 | RETURN_IF_EXCEPTION(throwScope, false); |
1793 | AttributeSetter::call(state, throwScope, [&] { |
1794 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::captureAttr, WTFMove(nativeValue)); |
1795 | }); |
1796 | return true; |
1797 | } |
1798 | |
1799 | bool setJSHTMLInputElementCapture(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1800 | { |
1801 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementCaptureSetter>(*state, thisValue, encodedValue, "capture" ); |
1802 | } |
1803 | |
1804 | #endif |
1805 | |
1806 | static inline JSValue jsHTMLInputElementWebkitdirectoryGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1807 | { |
1808 | UNUSED_PARAM(throwScope); |
1809 | UNUSED_PARAM(state); |
1810 | auto& impl = thisObject.wrapped(); |
1811 | JSValue result = toJS<IDLBoolean>(state, throwScope, impl.hasAttributeWithoutSynchronization(WebCore::HTMLNames::webkitdirectoryAttr)); |
1812 | return result; |
1813 | } |
1814 | |
1815 | EncodedJSValue jsHTMLInputElementWebkitdirectory(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1816 | { |
1817 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementWebkitdirectoryGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "webkitdirectory" ); |
1818 | } |
1819 | |
1820 | static inline bool setJSHTMLInputElementWebkitdirectorySetter(ExecState& state, JSHTMLInputElement& thisObject, JSValue value, ThrowScope& throwScope) |
1821 | { |
1822 | UNUSED_PARAM(throwScope); |
1823 | auto& impl = thisObject.wrapped(); |
1824 | auto nativeValue = convert<IDLBoolean>(state, value); |
1825 | RETURN_IF_EXCEPTION(throwScope, false); |
1826 | AttributeSetter::call(state, throwScope, [&] { |
1827 | return impl.setBooleanAttribute(WebCore::HTMLNames::webkitdirectoryAttr, WTFMove(nativeValue)); |
1828 | }); |
1829 | return true; |
1830 | } |
1831 | |
1832 | bool setJSHTMLInputElementWebkitdirectory(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
1833 | { |
1834 | return IDLAttribute<JSHTMLInputElement>::set<setJSHTMLInputElementWebkitdirectorySetter>(*state, thisValue, encodedValue, "webkitdirectory" ); |
1835 | } |
1836 | |
1837 | static inline JSValue jsHTMLInputElementWebkitEntriesGetter(ExecState& state, JSHTMLInputElement& thisObject, ThrowScope& throwScope) |
1838 | { |
1839 | UNUSED_PARAM(throwScope); |
1840 | UNUSED_PARAM(state); |
1841 | if (JSValue cachedValue = thisObject.m_webkitEntries.get()) |
1842 | return cachedValue; |
1843 | auto* context = jsCast<JSDOMGlobalObject*>(state.lexicalGlobalObject())->scriptExecutionContext(); |
1844 | if (UNLIKELY(!context)) |
1845 | return jsUndefined(); |
1846 | auto& impl = thisObject.wrapped(); |
1847 | JSValue result = toJS<IDLFrozenArray<IDLInterface<FileSystemEntry>>>(state, *thisObject.globalObject(), throwScope, WebCore::HTMLInputElementEntriesAPI::webkitEntries(*context, impl)); |
1848 | thisObject.m_webkitEntries.set(state.vm(), &thisObject, result); |
1849 | return result; |
1850 | } |
1851 | |
1852 | EncodedJSValue jsHTMLInputElementWebkitEntries(ExecState* state, EncodedJSValue thisValue, PropertyName) |
1853 | { |
1854 | return IDLAttribute<JSHTMLInputElement>::get<jsHTMLInputElementWebkitEntriesGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "webkitEntries" ); |
1855 | } |
1856 | |
1857 | static inline JSC::EncodedJSValue jsHTMLInputElementPrototypeFunctionStepUpBody(JSC::ExecState* state, typename IDLOperation<JSHTMLInputElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1858 | { |
1859 | UNUSED_PARAM(state); |
1860 | UNUSED_PARAM(throwScope); |
1861 | auto& impl = castedThis->wrapped(); |
1862 | auto n = state->argument(0).isUndefined() ? 1 : convert<IDLLong>(*state, state->uncheckedArgument(0)); |
1863 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1864 | propagateException(*state, throwScope, impl.stepUp(WTFMove(n))); |
1865 | return JSValue::encode(jsUndefined()); |
1866 | } |
1867 | |
1868 | EncodedJSValue JSC_HOST_CALL jsHTMLInputElementPrototypeFunctionStepUp(ExecState* state) |
1869 | { |
1870 | return IDLOperation<JSHTMLInputElement>::call<jsHTMLInputElementPrototypeFunctionStepUpBody>(*state, "stepUp" ); |
1871 | } |
1872 | |
1873 | static inline JSC::EncodedJSValue jsHTMLInputElementPrototypeFunctionStepDownBody(JSC::ExecState* state, typename IDLOperation<JSHTMLInputElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1874 | { |
1875 | UNUSED_PARAM(state); |
1876 | UNUSED_PARAM(throwScope); |
1877 | auto& impl = castedThis->wrapped(); |
1878 | auto n = state->argument(0).isUndefined() ? 1 : convert<IDLLong>(*state, state->uncheckedArgument(0)); |
1879 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1880 | propagateException(*state, throwScope, impl.stepDown(WTFMove(n))); |
1881 | return JSValue::encode(jsUndefined()); |
1882 | } |
1883 | |
1884 | EncodedJSValue JSC_HOST_CALL jsHTMLInputElementPrototypeFunctionStepDown(ExecState* state) |
1885 | { |
1886 | return IDLOperation<JSHTMLInputElement>::call<jsHTMLInputElementPrototypeFunctionStepDownBody>(*state, "stepDown" ); |
1887 | } |
1888 | |
1889 | static inline JSC::EncodedJSValue jsHTMLInputElementPrototypeFunctionCheckValidityBody(JSC::ExecState* state, typename IDLOperation<JSHTMLInputElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1890 | { |
1891 | UNUSED_PARAM(state); |
1892 | UNUSED_PARAM(throwScope); |
1893 | auto& impl = castedThis->wrapped(); |
1894 | return JSValue::encode(toJS<IDLBoolean>(impl.checkValidity())); |
1895 | } |
1896 | |
1897 | EncodedJSValue JSC_HOST_CALL jsHTMLInputElementPrototypeFunctionCheckValidity(ExecState* state) |
1898 | { |
1899 | return IDLOperation<JSHTMLInputElement>::call<jsHTMLInputElementPrototypeFunctionCheckValidityBody>(*state, "checkValidity" ); |
1900 | } |
1901 | |
1902 | static inline JSC::EncodedJSValue jsHTMLInputElementPrototypeFunctionReportValidityBody(JSC::ExecState* state, typename IDLOperation<JSHTMLInputElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1903 | { |
1904 | UNUSED_PARAM(state); |
1905 | UNUSED_PARAM(throwScope); |
1906 | auto& impl = castedThis->wrapped(); |
1907 | return JSValue::encode(toJS<IDLBoolean>(impl.reportValidity())); |
1908 | } |
1909 | |
1910 | EncodedJSValue JSC_HOST_CALL jsHTMLInputElementPrototypeFunctionReportValidity(ExecState* state) |
1911 | { |
1912 | return IDLOperation<JSHTMLInputElement>::call<jsHTMLInputElementPrototypeFunctionReportValidityBody>(*state, "reportValidity" ); |
1913 | } |
1914 | |
1915 | static inline JSC::EncodedJSValue jsHTMLInputElementPrototypeFunctionSetCustomValidityBody(JSC::ExecState* state, typename IDLOperation<JSHTMLInputElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1916 | { |
1917 | UNUSED_PARAM(state); |
1918 | UNUSED_PARAM(throwScope); |
1919 | auto& impl = castedThis->wrapped(); |
1920 | if (UNLIKELY(state->argumentCount() < 1)) |
1921 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
1922 | auto error = convert<IDLDOMString>(*state, state->uncheckedArgument(0)); |
1923 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1924 | impl.setCustomValidity(WTFMove(error)); |
1925 | return JSValue::encode(jsUndefined()); |
1926 | } |
1927 | |
1928 | EncodedJSValue JSC_HOST_CALL jsHTMLInputElementPrototypeFunctionSetCustomValidity(ExecState* state) |
1929 | { |
1930 | return IDLOperation<JSHTMLInputElement>::call<jsHTMLInputElementPrototypeFunctionSetCustomValidityBody>(*state, "setCustomValidity" ); |
1931 | } |
1932 | |
1933 | static inline JSC::EncodedJSValue jsHTMLInputElementPrototypeFunctionSelectBody(JSC::ExecState* state, typename IDLOperation<JSHTMLInputElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1934 | { |
1935 | UNUSED_PARAM(state); |
1936 | UNUSED_PARAM(throwScope); |
1937 | auto& impl = castedThis->wrapped(); |
1938 | impl.select(); |
1939 | return JSValue::encode(jsUndefined()); |
1940 | } |
1941 | |
1942 | EncodedJSValue JSC_HOST_CALL jsHTMLInputElementPrototypeFunctionSelect(ExecState* state) |
1943 | { |
1944 | return IDLOperation<JSHTMLInputElement>::call<jsHTMLInputElementPrototypeFunctionSelectBody>(*state, "select" ); |
1945 | } |
1946 | |
1947 | static inline JSC::EncodedJSValue jsHTMLInputElementPrototypeFunctionSetRangeText1Body(JSC::ExecState* state, typename IDLOperation<JSHTMLInputElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1948 | { |
1949 | UNUSED_PARAM(state); |
1950 | UNUSED_PARAM(throwScope); |
1951 | auto& impl = castedThis->wrapped(); |
1952 | auto replacement = convert<IDLDOMString>(*state, state->uncheckedArgument(0)); |
1953 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1954 | propagateException(*state, throwScope, impl.setRangeText(WTFMove(replacement))); |
1955 | return JSValue::encode(jsUndefined()); |
1956 | } |
1957 | |
1958 | static inline JSC::EncodedJSValue jsHTMLInputElementPrototypeFunctionSetRangeText2Body(JSC::ExecState* state, typename IDLOperation<JSHTMLInputElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1959 | { |
1960 | UNUSED_PARAM(state); |
1961 | UNUSED_PARAM(throwScope); |
1962 | auto& impl = castedThis->wrapped(); |
1963 | auto replacement = convert<IDLDOMString>(*state, state->uncheckedArgument(0)); |
1964 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1965 | auto start = convert<IDLUnsignedLong>(*state, state->uncheckedArgument(1)); |
1966 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1967 | auto end = convert<IDLUnsignedLong>(*state, state->uncheckedArgument(2)); |
1968 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1969 | auto selectionMode = state->argument(3).isUndefined() ? String() : convert<IDLDOMString>(*state, state->uncheckedArgument(3)); |
1970 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
1971 | propagateException(*state, throwScope, impl.setRangeText(WTFMove(replacement), WTFMove(start), WTFMove(end), WTFMove(selectionMode))); |
1972 | return JSValue::encode(jsUndefined()); |
1973 | } |
1974 | |
1975 | static inline JSC::EncodedJSValue jsHTMLInputElementPrototypeFunctionSetRangeTextOverloadDispatcher(JSC::ExecState* state, typename IDLOperation<JSHTMLInputElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
1976 | { |
1977 | UNUSED_PARAM(state); |
1978 | UNUSED_PARAM(throwScope); |
1979 | VM& vm = state->vm(); |
1980 | UNUSED_PARAM(vm); |
1981 | size_t argsCount = std::min<size_t>(4, state->argumentCount()); |
1982 | if (argsCount == 1) { |
1983 | return jsHTMLInputElementPrototypeFunctionSetRangeText1Body(state, castedThis, throwScope); |
1984 | } |
1985 | if (argsCount == 3) { |
1986 | return jsHTMLInputElementPrototypeFunctionSetRangeText2Body(state, castedThis, throwScope); |
1987 | } |
1988 | if (argsCount == 4) { |
1989 | return jsHTMLInputElementPrototypeFunctionSetRangeText2Body(state, castedThis, throwScope); |
1990 | } |
1991 | return argsCount < 1 ? throwVMError(state, throwScope, createNotEnoughArgumentsError(state)) : throwVMTypeError(state, throwScope); |
1992 | } |
1993 | |
1994 | EncodedJSValue JSC_HOST_CALL jsHTMLInputElementPrototypeFunctionSetRangeText(ExecState* state) |
1995 | { |
1996 | return IDLOperation<JSHTMLInputElement>::call<jsHTMLInputElementPrototypeFunctionSetRangeTextOverloadDispatcher>(*state, "setRangeText" ); |
1997 | } |
1998 | |
1999 | static inline JSC::EncodedJSValue jsHTMLInputElementPrototypeFunctionSetSelectionRangeBody(JSC::ExecState* state, typename IDLOperation<JSHTMLInputElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
2000 | { |
2001 | UNUSED_PARAM(state); |
2002 | UNUSED_PARAM(throwScope); |
2003 | auto& impl = castedThis->wrapped(); |
2004 | if (UNLIKELY(state->argumentCount() < 2)) |
2005 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
2006 | auto start = convert<IDLLong>(*state, state->uncheckedArgument(0)); |
2007 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2008 | auto end = convert<IDLLong>(*state, state->uncheckedArgument(1)); |
2009 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2010 | auto direction = state->argument(2).isUndefined() ? String() : convert<IDLDOMString>(*state, state->uncheckedArgument(2)); |
2011 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
2012 | propagateException(*state, throwScope, impl.setSelectionRangeForBindings(WTFMove(start), WTFMove(end), WTFMove(direction))); |
2013 | return JSValue::encode(jsUndefined()); |
2014 | } |
2015 | |
2016 | EncodedJSValue JSC_HOST_CALL jsHTMLInputElementPrototypeFunctionSetSelectionRange(ExecState* state) |
2017 | { |
2018 | return IDLOperation<JSHTMLInputElement>::call<jsHTMLInputElementPrototypeFunctionSetSelectionRangeBody>(*state, "setSelectionRange" ); |
2019 | } |
2020 | |
2021 | void JSHTMLInputElement::visitChildren(JSCell* cell, SlotVisitor& visitor) |
2022 | { |
2023 | auto* thisObject = jsCast<JSHTMLInputElement*>(cell); |
2024 | ASSERT_GC_OBJECT_INHERITS(thisObject, info()); |
2025 | Base::visitChildren(thisObject, visitor); |
2026 | visitor.append(thisObject->m_webkitEntries); |
2027 | } |
2028 | |
2029 | void JSHTMLInputElement::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
2030 | { |
2031 | auto* thisObject = jsCast<JSHTMLInputElement*>(cell); |
2032 | builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
2033 | if (thisObject->scriptExecutionContext()) |
2034 | builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
2035 | Base::heapSnapshot(cell, builder); |
2036 | } |
2037 | |
2038 | HTMLInputElement* JSHTMLInputElement::toWrapped(JSC::VM& vm, JSC::JSValue value) |
2039 | { |
2040 | if (auto* wrapper = jsDynamicCast<JSHTMLInputElement*>(vm, value)) |
2041 | return &wrapper->wrapped(); |
2042 | return nullptr; |
2043 | } |
2044 | |
2045 | } |
2046 | |