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 "JSInspectorAuditAccessibilityObject.h" |
23 | |
24 | #include "Document.h" |
25 | #include "JSDOMBinding.h" |
26 | #include "JSDOMConvertBoolean.h" |
27 | #include "JSDOMConvertInterface.h" |
28 | #include "JSDOMConvertNullable.h" |
29 | #include "JSDOMConvertNumbers.h" |
30 | #include "JSDOMConvertSequences.h" |
31 | #include "JSDOMConvertStrings.h" |
32 | #include "JSDOMExceptionHandling.h" |
33 | #include "JSDOMGlobalObject.h" |
34 | #include "JSDOMOperation.h" |
35 | #include "JSDOMWrapperCache.h" |
36 | #include "JSNode.h" |
37 | #include "ScriptExecutionContext.h" |
38 | #include <JavaScriptCore/HeapSnapshotBuilder.h> |
39 | #include <JavaScriptCore/JSArray.h> |
40 | #include <JavaScriptCore/JSCInlines.h> |
41 | #include <JavaScriptCore/ObjectConstructor.h> |
42 | #include <wtf/GetPtr.h> |
43 | #include <wtf/PointerPreparations.h> |
44 | #include <wtf/URL.h> |
45 | |
46 | |
47 | namespace WebCore { |
48 | using namespace JSC; |
49 | |
50 | template<> InspectorAuditAccessibilityObject::ComputedProperties convertDictionary<InspectorAuditAccessibilityObject::ComputedProperties>(ExecState& state, JSValue value) |
51 | { |
52 | VM& vm = state.vm(); |
53 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
54 | bool isNullOrUndefined = value.isUndefinedOrNull(); |
55 | auto* object = isNullOrUndefined ? nullptr : value.getObject(); |
56 | if (UNLIKELY(!isNullOrUndefined && !object)) { |
57 | throwTypeError(&state, throwScope); |
58 | return { }; |
59 | } |
60 | InspectorAuditAccessibilityObject::ComputedProperties result; |
61 | JSValue busyValue; |
62 | if (isNullOrUndefined) |
63 | busyValue = jsUndefined(); |
64 | else { |
65 | busyValue = object->get(&state, Identifier::fromString(&state, "busy" )); |
66 | RETURN_IF_EXCEPTION(throwScope, { }); |
67 | } |
68 | if (!busyValue.isUndefined()) { |
69 | result.busy = convert<IDLNullable<IDLBoolean>>(state, busyValue); |
70 | RETURN_IF_EXCEPTION(throwScope, { }); |
71 | } |
72 | JSValue checkedValue; |
73 | if (isNullOrUndefined) |
74 | checkedValue = jsUndefined(); |
75 | else { |
76 | checkedValue = object->get(&state, Identifier::fromString(&state, "checked" )); |
77 | RETURN_IF_EXCEPTION(throwScope, { }); |
78 | } |
79 | if (!checkedValue.isUndefined()) { |
80 | result.checked = convert<IDLNullable<IDLDOMString>>(state, checkedValue); |
81 | RETURN_IF_EXCEPTION(throwScope, { }); |
82 | } |
83 | JSValue currentStateValue; |
84 | if (isNullOrUndefined) |
85 | currentStateValue = jsUndefined(); |
86 | else { |
87 | currentStateValue = object->get(&state, Identifier::fromString(&state, "currentState" )); |
88 | RETURN_IF_EXCEPTION(throwScope, { }); |
89 | } |
90 | if (!currentStateValue.isUndefined()) { |
91 | result.currentState = convert<IDLNullable<IDLDOMString>>(state, currentStateValue); |
92 | RETURN_IF_EXCEPTION(throwScope, { }); |
93 | } |
94 | JSValue disabledValue; |
95 | if (isNullOrUndefined) |
96 | disabledValue = jsUndefined(); |
97 | else { |
98 | disabledValue = object->get(&state, Identifier::fromString(&state, "disabled" )); |
99 | RETURN_IF_EXCEPTION(throwScope, { }); |
100 | } |
101 | if (!disabledValue.isUndefined()) { |
102 | result.disabled = convert<IDLNullable<IDLBoolean>>(state, disabledValue); |
103 | RETURN_IF_EXCEPTION(throwScope, { }); |
104 | } |
105 | JSValue expandedValue; |
106 | if (isNullOrUndefined) |
107 | expandedValue = jsUndefined(); |
108 | else { |
109 | expandedValue = object->get(&state, Identifier::fromString(&state, "expanded" )); |
110 | RETURN_IF_EXCEPTION(throwScope, { }); |
111 | } |
112 | if (!expandedValue.isUndefined()) { |
113 | result.expanded = convert<IDLNullable<IDLBoolean>>(state, expandedValue); |
114 | RETURN_IF_EXCEPTION(throwScope, { }); |
115 | } |
116 | JSValue focusedValue; |
117 | if (isNullOrUndefined) |
118 | focusedValue = jsUndefined(); |
119 | else { |
120 | focusedValue = object->get(&state, Identifier::fromString(&state, "focused" )); |
121 | RETURN_IF_EXCEPTION(throwScope, { }); |
122 | } |
123 | if (!focusedValue.isUndefined()) { |
124 | result.focused = convert<IDLNullable<IDLBoolean>>(state, focusedValue); |
125 | RETURN_IF_EXCEPTION(throwScope, { }); |
126 | } |
127 | JSValue headingLevelValue; |
128 | if (isNullOrUndefined) |
129 | headingLevelValue = jsUndefined(); |
130 | else { |
131 | headingLevelValue = object->get(&state, Identifier::fromString(&state, "headingLevel" )); |
132 | RETURN_IF_EXCEPTION(throwScope, { }); |
133 | } |
134 | if (!headingLevelValue.isUndefined()) { |
135 | result.headingLevel = convert<IDLNullable<IDLLong>>(state, headingLevelValue); |
136 | RETURN_IF_EXCEPTION(throwScope, { }); |
137 | } |
138 | JSValue hiddenValue; |
139 | if (isNullOrUndefined) |
140 | hiddenValue = jsUndefined(); |
141 | else { |
142 | hiddenValue = object->get(&state, Identifier::fromString(&state, "hidden" )); |
143 | RETURN_IF_EXCEPTION(throwScope, { }); |
144 | } |
145 | if (!hiddenValue.isUndefined()) { |
146 | result.hidden = convert<IDLNullable<IDLBoolean>>(state, hiddenValue); |
147 | RETURN_IF_EXCEPTION(throwScope, { }); |
148 | } |
149 | JSValue hierarchicalLevelValue; |
150 | if (isNullOrUndefined) |
151 | hierarchicalLevelValue = jsUndefined(); |
152 | else { |
153 | hierarchicalLevelValue = object->get(&state, Identifier::fromString(&state, "hierarchicalLevel" )); |
154 | RETURN_IF_EXCEPTION(throwScope, { }); |
155 | } |
156 | if (!hierarchicalLevelValue.isUndefined()) { |
157 | result.hierarchicalLevel = convert<IDLNullable<IDLLong>>(state, hierarchicalLevelValue); |
158 | RETURN_IF_EXCEPTION(throwScope, { }); |
159 | } |
160 | JSValue ignoredValue; |
161 | if (isNullOrUndefined) |
162 | ignoredValue = jsUndefined(); |
163 | else { |
164 | ignoredValue = object->get(&state, Identifier::fromString(&state, "ignored" )); |
165 | RETURN_IF_EXCEPTION(throwScope, { }); |
166 | } |
167 | if (!ignoredValue.isUndefined()) { |
168 | result.ignored = convert<IDLNullable<IDLBoolean>>(state, ignoredValue); |
169 | RETURN_IF_EXCEPTION(throwScope, { }); |
170 | } |
171 | JSValue ignoredByDefaultValue; |
172 | if (isNullOrUndefined) |
173 | ignoredByDefaultValue = jsUndefined(); |
174 | else { |
175 | ignoredByDefaultValue = object->get(&state, Identifier::fromString(&state, "ignoredByDefault" )); |
176 | RETURN_IF_EXCEPTION(throwScope, { }); |
177 | } |
178 | if (!ignoredByDefaultValue.isUndefined()) { |
179 | result.ignoredByDefault = convert<IDLNullable<IDLBoolean>>(state, ignoredByDefaultValue); |
180 | RETURN_IF_EXCEPTION(throwScope, { }); |
181 | } |
182 | JSValue invalidStatusValue; |
183 | if (isNullOrUndefined) |
184 | invalidStatusValue = jsUndefined(); |
185 | else { |
186 | invalidStatusValue = object->get(&state, Identifier::fromString(&state, "invalidStatus" )); |
187 | RETURN_IF_EXCEPTION(throwScope, { }); |
188 | } |
189 | if (!invalidStatusValue.isUndefined()) { |
190 | result.invalidStatus = convert<IDLNullable<IDLDOMString>>(state, invalidStatusValue); |
191 | RETURN_IF_EXCEPTION(throwScope, { }); |
192 | } |
193 | JSValue ; |
194 | if (isNullOrUndefined) |
195 | isPopUpButtonValue = jsUndefined(); |
196 | else { |
197 | isPopUpButtonValue = object->get(&state, Identifier::fromString(&state, "isPopUpButton" )); |
198 | RETURN_IF_EXCEPTION(throwScope, { }); |
199 | } |
200 | if (!isPopUpButtonValue.isUndefined()) { |
201 | result.isPopUpButton = convert<IDLNullable<IDLBoolean>>(state, isPopUpButtonValue); |
202 | RETURN_IF_EXCEPTION(throwScope, { }); |
203 | } |
204 | JSValue labelValue; |
205 | if (isNullOrUndefined) |
206 | labelValue = jsUndefined(); |
207 | else { |
208 | labelValue = object->get(&state, Identifier::fromString(&state, "label" )); |
209 | RETURN_IF_EXCEPTION(throwScope, { }); |
210 | } |
211 | if (!labelValue.isUndefined()) { |
212 | result.label = convert<IDLNullable<IDLDOMString>>(state, labelValue); |
213 | RETURN_IF_EXCEPTION(throwScope, { }); |
214 | } |
215 | JSValue liveRegionAtomicValue; |
216 | if (isNullOrUndefined) |
217 | liveRegionAtomicValue = jsUndefined(); |
218 | else { |
219 | liveRegionAtomicValue = object->get(&state, Identifier::fromString(&state, "liveRegionAtomic" )); |
220 | RETURN_IF_EXCEPTION(throwScope, { }); |
221 | } |
222 | if (!liveRegionAtomicValue.isUndefined()) { |
223 | result.liveRegionAtomic = convert<IDLNullable<IDLBoolean>>(state, liveRegionAtomicValue); |
224 | RETURN_IF_EXCEPTION(throwScope, { }); |
225 | } |
226 | JSValue liveRegionRelevantValue; |
227 | if (isNullOrUndefined) |
228 | liveRegionRelevantValue = jsUndefined(); |
229 | else { |
230 | liveRegionRelevantValue = object->get(&state, Identifier::fromString(&state, "liveRegionRelevant" )); |
231 | RETURN_IF_EXCEPTION(throwScope, { }); |
232 | } |
233 | if (!liveRegionRelevantValue.isUndefined()) { |
234 | result.liveRegionRelevant = convert<IDLNullable<IDLSequence<IDLDOMString>>>(state, liveRegionRelevantValue); |
235 | RETURN_IF_EXCEPTION(throwScope, { }); |
236 | } |
237 | JSValue liveRegionStatusValue; |
238 | if (isNullOrUndefined) |
239 | liveRegionStatusValue = jsUndefined(); |
240 | else { |
241 | liveRegionStatusValue = object->get(&state, Identifier::fromString(&state, "liveRegionStatus" )); |
242 | RETURN_IF_EXCEPTION(throwScope, { }); |
243 | } |
244 | if (!liveRegionStatusValue.isUndefined()) { |
245 | result.liveRegionStatus = convert<IDLNullable<IDLDOMString>>(state, liveRegionStatusValue); |
246 | RETURN_IF_EXCEPTION(throwScope, { }); |
247 | } |
248 | JSValue pressedValue; |
249 | if (isNullOrUndefined) |
250 | pressedValue = jsUndefined(); |
251 | else { |
252 | pressedValue = object->get(&state, Identifier::fromString(&state, "pressed" )); |
253 | RETURN_IF_EXCEPTION(throwScope, { }); |
254 | } |
255 | if (!pressedValue.isUndefined()) { |
256 | result.pressed = convert<IDLNullable<IDLBoolean>>(state, pressedValue); |
257 | RETURN_IF_EXCEPTION(throwScope, { }); |
258 | } |
259 | JSValue readonlyValue; |
260 | if (isNullOrUndefined) |
261 | readonlyValue = jsUndefined(); |
262 | else { |
263 | readonlyValue = object->get(&state, Identifier::fromString(&state, "readonly" )); |
264 | RETURN_IF_EXCEPTION(throwScope, { }); |
265 | } |
266 | if (!readonlyValue.isUndefined()) { |
267 | result.readonly = convert<IDLNullable<IDLBoolean>>(state, readonlyValue); |
268 | RETURN_IF_EXCEPTION(throwScope, { }); |
269 | } |
270 | JSValue requiredValue; |
271 | if (isNullOrUndefined) |
272 | requiredValue = jsUndefined(); |
273 | else { |
274 | requiredValue = object->get(&state, Identifier::fromString(&state, "required" )); |
275 | RETURN_IF_EXCEPTION(throwScope, { }); |
276 | } |
277 | if (!requiredValue.isUndefined()) { |
278 | result.required = convert<IDLNullable<IDLBoolean>>(state, requiredValue); |
279 | RETURN_IF_EXCEPTION(throwScope, { }); |
280 | } |
281 | JSValue roleValue; |
282 | if (isNullOrUndefined) |
283 | roleValue = jsUndefined(); |
284 | else { |
285 | roleValue = object->get(&state, Identifier::fromString(&state, "role" )); |
286 | RETURN_IF_EXCEPTION(throwScope, { }); |
287 | } |
288 | if (!roleValue.isUndefined()) { |
289 | result.role = convert<IDLNullable<IDLDOMString>>(state, roleValue); |
290 | RETURN_IF_EXCEPTION(throwScope, { }); |
291 | } |
292 | JSValue selectedValue; |
293 | if (isNullOrUndefined) |
294 | selectedValue = jsUndefined(); |
295 | else { |
296 | selectedValue = object->get(&state, Identifier::fromString(&state, "selected" )); |
297 | RETURN_IF_EXCEPTION(throwScope, { }); |
298 | } |
299 | if (!selectedValue.isUndefined()) { |
300 | result.selected = convert<IDLNullable<IDLBoolean>>(state, selectedValue); |
301 | RETURN_IF_EXCEPTION(throwScope, { }); |
302 | } |
303 | return result; |
304 | } |
305 | |
306 | JSC::JSObject* convertDictionaryToJS(JSC::ExecState& state, JSDOMGlobalObject& globalObject, const InspectorAuditAccessibilityObject::ComputedProperties& dictionary) |
307 | { |
308 | auto& vm = state.vm(); |
309 | |
310 | auto result = constructEmptyObject(&state, globalObject.objectPrototype()); |
311 | |
312 | if (!IDLNullable<IDLBoolean>::isNullValue(dictionary.busy)) { |
313 | auto busyValue = toJS<IDLNullable<IDLBoolean>>(IDLNullable<IDLBoolean>::extractValueFromNullable(dictionary.busy)); |
314 | result->putDirect(vm, JSC::Identifier::fromString(&vm, "busy" ), busyValue); |
315 | } |
316 | if (!IDLNullable<IDLDOMString>::isNullValue(dictionary.checked)) { |
317 | auto checkedValue = toJS<IDLNullable<IDLDOMString>>(state, IDLNullable<IDLDOMString>::extractValueFromNullable(dictionary.checked)); |
318 | result->putDirect(vm, JSC::Identifier::fromString(&vm, "checked" ), checkedValue); |
319 | } |
320 | if (!IDLNullable<IDLDOMString>::isNullValue(dictionary.currentState)) { |
321 | auto currentStateValue = toJS<IDLNullable<IDLDOMString>>(state, IDLNullable<IDLDOMString>::extractValueFromNullable(dictionary.currentState)); |
322 | result->putDirect(vm, JSC::Identifier::fromString(&vm, "currentState" ), currentStateValue); |
323 | } |
324 | if (!IDLNullable<IDLBoolean>::isNullValue(dictionary.disabled)) { |
325 | auto disabledValue = toJS<IDLNullable<IDLBoolean>>(IDLNullable<IDLBoolean>::extractValueFromNullable(dictionary.disabled)); |
326 | result->putDirect(vm, JSC::Identifier::fromString(&vm, "disabled" ), disabledValue); |
327 | } |
328 | if (!IDLNullable<IDLBoolean>::isNullValue(dictionary.expanded)) { |
329 | auto expandedValue = toJS<IDLNullable<IDLBoolean>>(IDLNullable<IDLBoolean>::extractValueFromNullable(dictionary.expanded)); |
330 | result->putDirect(vm, JSC::Identifier::fromString(&vm, "expanded" ), expandedValue); |
331 | } |
332 | if (!IDLNullable<IDLBoolean>::isNullValue(dictionary.focused)) { |
333 | auto focusedValue = toJS<IDLNullable<IDLBoolean>>(IDLNullable<IDLBoolean>::extractValueFromNullable(dictionary.focused)); |
334 | result->putDirect(vm, JSC::Identifier::fromString(&vm, "focused" ), focusedValue); |
335 | } |
336 | if (!IDLNullable<IDLLong>::isNullValue(dictionary.headingLevel)) { |
337 | auto headingLevelValue = toJS<IDLNullable<IDLLong>>(IDLNullable<IDLLong>::extractValueFromNullable(dictionary.headingLevel)); |
338 | result->putDirect(vm, JSC::Identifier::fromString(&vm, "headingLevel" ), headingLevelValue); |
339 | } |
340 | if (!IDLNullable<IDLBoolean>::isNullValue(dictionary.hidden)) { |
341 | auto hiddenValue = toJS<IDLNullable<IDLBoolean>>(IDLNullable<IDLBoolean>::extractValueFromNullable(dictionary.hidden)); |
342 | result->putDirect(vm, JSC::Identifier::fromString(&vm, "hidden" ), hiddenValue); |
343 | } |
344 | if (!IDLNullable<IDLLong>::isNullValue(dictionary.hierarchicalLevel)) { |
345 | auto hierarchicalLevelValue = toJS<IDLNullable<IDLLong>>(IDLNullable<IDLLong>::extractValueFromNullable(dictionary.hierarchicalLevel)); |
346 | result->putDirect(vm, JSC::Identifier::fromString(&vm, "hierarchicalLevel" ), hierarchicalLevelValue); |
347 | } |
348 | if (!IDLNullable<IDLBoolean>::isNullValue(dictionary.ignored)) { |
349 | auto ignoredValue = toJS<IDLNullable<IDLBoolean>>(IDLNullable<IDLBoolean>::extractValueFromNullable(dictionary.ignored)); |
350 | result->putDirect(vm, JSC::Identifier::fromString(&vm, "ignored" ), ignoredValue); |
351 | } |
352 | if (!IDLNullable<IDLBoolean>::isNullValue(dictionary.ignoredByDefault)) { |
353 | auto ignoredByDefaultValue = toJS<IDLNullable<IDLBoolean>>(IDLNullable<IDLBoolean>::extractValueFromNullable(dictionary.ignoredByDefault)); |
354 | result->putDirect(vm, JSC::Identifier::fromString(&vm, "ignoredByDefault" ), ignoredByDefaultValue); |
355 | } |
356 | if (!IDLNullable<IDLDOMString>::isNullValue(dictionary.invalidStatus)) { |
357 | auto invalidStatusValue = toJS<IDLNullable<IDLDOMString>>(state, IDLNullable<IDLDOMString>::extractValueFromNullable(dictionary.invalidStatus)); |
358 | result->putDirect(vm, JSC::Identifier::fromString(&vm, "invalidStatus" ), invalidStatusValue); |
359 | } |
360 | if (!IDLNullable<IDLBoolean>::isNullValue(dictionary.isPopUpButton)) { |
361 | auto = toJS<IDLNullable<IDLBoolean>>(IDLNullable<IDLBoolean>::extractValueFromNullable(dictionary.isPopUpButton)); |
362 | result->putDirect(vm, JSC::Identifier::fromString(&vm, "isPopUpButton" ), isPopUpButtonValue); |
363 | } |
364 | if (!IDLNullable<IDLDOMString>::isNullValue(dictionary.label)) { |
365 | auto labelValue = toJS<IDLNullable<IDLDOMString>>(state, IDLNullable<IDLDOMString>::extractValueFromNullable(dictionary.label)); |
366 | result->putDirect(vm, JSC::Identifier::fromString(&vm, "label" ), labelValue); |
367 | } |
368 | if (!IDLNullable<IDLBoolean>::isNullValue(dictionary.liveRegionAtomic)) { |
369 | auto liveRegionAtomicValue = toJS<IDLNullable<IDLBoolean>>(IDLNullable<IDLBoolean>::extractValueFromNullable(dictionary.liveRegionAtomic)); |
370 | result->putDirect(vm, JSC::Identifier::fromString(&vm, "liveRegionAtomic" ), liveRegionAtomicValue); |
371 | } |
372 | if (!IDLNullable<IDLSequence<IDLDOMString>>::isNullValue(dictionary.liveRegionRelevant)) { |
373 | auto liveRegionRelevantValue = toJS<IDLNullable<IDLSequence<IDLDOMString>>>(state, globalObject, IDLNullable<IDLSequence<IDLDOMString>>::extractValueFromNullable(dictionary.liveRegionRelevant)); |
374 | result->putDirect(vm, JSC::Identifier::fromString(&vm, "liveRegionRelevant" ), liveRegionRelevantValue); |
375 | } |
376 | if (!IDLNullable<IDLDOMString>::isNullValue(dictionary.liveRegionStatus)) { |
377 | auto liveRegionStatusValue = toJS<IDLNullable<IDLDOMString>>(state, IDLNullable<IDLDOMString>::extractValueFromNullable(dictionary.liveRegionStatus)); |
378 | result->putDirect(vm, JSC::Identifier::fromString(&vm, "liveRegionStatus" ), liveRegionStatusValue); |
379 | } |
380 | if (!IDLNullable<IDLBoolean>::isNullValue(dictionary.pressed)) { |
381 | auto pressedValue = toJS<IDLNullable<IDLBoolean>>(IDLNullable<IDLBoolean>::extractValueFromNullable(dictionary.pressed)); |
382 | result->putDirect(vm, JSC::Identifier::fromString(&vm, "pressed" ), pressedValue); |
383 | } |
384 | if (!IDLNullable<IDLBoolean>::isNullValue(dictionary.readonly)) { |
385 | auto readonlyValue = toJS<IDLNullable<IDLBoolean>>(IDLNullable<IDLBoolean>::extractValueFromNullable(dictionary.readonly)); |
386 | result->putDirect(vm, JSC::Identifier::fromString(&vm, "readonly" ), readonlyValue); |
387 | } |
388 | if (!IDLNullable<IDLBoolean>::isNullValue(dictionary.required)) { |
389 | auto requiredValue = toJS<IDLNullable<IDLBoolean>>(IDLNullable<IDLBoolean>::extractValueFromNullable(dictionary.required)); |
390 | result->putDirect(vm, JSC::Identifier::fromString(&vm, "required" ), requiredValue); |
391 | } |
392 | if (!IDLNullable<IDLDOMString>::isNullValue(dictionary.role)) { |
393 | auto roleValue = toJS<IDLNullable<IDLDOMString>>(state, IDLNullable<IDLDOMString>::extractValueFromNullable(dictionary.role)); |
394 | result->putDirect(vm, JSC::Identifier::fromString(&vm, "role" ), roleValue); |
395 | } |
396 | if (!IDLNullable<IDLBoolean>::isNullValue(dictionary.selected)) { |
397 | auto selectedValue = toJS<IDLNullable<IDLBoolean>>(IDLNullable<IDLBoolean>::extractValueFromNullable(dictionary.selected)); |
398 | result->putDirect(vm, JSC::Identifier::fromString(&vm, "selected" ), selectedValue); |
399 | } |
400 | return result; |
401 | } |
402 | |
403 | // Functions |
404 | |
405 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorAuditAccessibilityObjectPrototypeFunctionGetElementsByComputedRole(JSC::ExecState*); |
406 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorAuditAccessibilityObjectPrototypeFunctionGetActiveDescendant(JSC::ExecState*); |
407 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorAuditAccessibilityObjectPrototypeFunctionGetChildNodes(JSC::ExecState*); |
408 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorAuditAccessibilityObjectPrototypeFunctionGetComputedProperties(JSC::ExecState*); |
409 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorAuditAccessibilityObjectPrototypeFunctionGetControlledNodes(JSC::ExecState*); |
410 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorAuditAccessibilityObjectPrototypeFunctionGetFlowedNodes(JSC::ExecState*); |
411 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorAuditAccessibilityObjectPrototypeFunctionGetMouseEventNode(JSC::ExecState*); |
412 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorAuditAccessibilityObjectPrototypeFunctionGetOwnedNodes(JSC::ExecState*); |
413 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorAuditAccessibilityObjectPrototypeFunctionGetParentNode(JSC::ExecState*); |
414 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorAuditAccessibilityObjectPrototypeFunctionGetSelectedChildNodes(JSC::ExecState*); |
415 | |
416 | class JSInspectorAuditAccessibilityObjectPrototype : public JSC::JSNonFinalObject { |
417 | public: |
418 | using Base = JSC::JSNonFinalObject; |
419 | static JSInspectorAuditAccessibilityObjectPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
420 | { |
421 | JSInspectorAuditAccessibilityObjectPrototype* ptr = new (NotNull, JSC::allocateCell<JSInspectorAuditAccessibilityObjectPrototype>(vm.heap)) JSInspectorAuditAccessibilityObjectPrototype(vm, globalObject, structure); |
422 | ptr->finishCreation(vm); |
423 | return ptr; |
424 | } |
425 | |
426 | DECLARE_INFO; |
427 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
428 | { |
429 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
430 | } |
431 | |
432 | private: |
433 | JSInspectorAuditAccessibilityObjectPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
434 | : JSC::JSNonFinalObject(vm, structure) |
435 | { |
436 | } |
437 | |
438 | void finishCreation(JSC::VM&); |
439 | }; |
440 | |
441 | /* Hash table for prototype */ |
442 | |
443 | static const HashTableValue JSInspectorAuditAccessibilityObjectPrototypeTableValues[] = |
444 | { |
445 | { "getElementsByComputedRole" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorAuditAccessibilityObjectPrototypeFunctionGetElementsByComputedRole), (intptr_t) (1) } }, |
446 | { "getActiveDescendant" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorAuditAccessibilityObjectPrototypeFunctionGetActiveDescendant), (intptr_t) (1) } }, |
447 | { "getChildNodes" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorAuditAccessibilityObjectPrototypeFunctionGetChildNodes), (intptr_t) (1) } }, |
448 | { "getComputedProperties" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorAuditAccessibilityObjectPrototypeFunctionGetComputedProperties), (intptr_t) (1) } }, |
449 | { "getControlledNodes" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorAuditAccessibilityObjectPrototypeFunctionGetControlledNodes), (intptr_t) (1) } }, |
450 | { "getFlowedNodes" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorAuditAccessibilityObjectPrototypeFunctionGetFlowedNodes), (intptr_t) (1) } }, |
451 | { "getMouseEventNode" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorAuditAccessibilityObjectPrototypeFunctionGetMouseEventNode), (intptr_t) (1) } }, |
452 | { "getOwnedNodes" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorAuditAccessibilityObjectPrototypeFunctionGetOwnedNodes), (intptr_t) (1) } }, |
453 | { "getParentNode" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorAuditAccessibilityObjectPrototypeFunctionGetParentNode), (intptr_t) (1) } }, |
454 | { "getSelectedChildNodes" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorAuditAccessibilityObjectPrototypeFunctionGetSelectedChildNodes), (intptr_t) (1) } }, |
455 | }; |
456 | |
457 | const ClassInfo JSInspectorAuditAccessibilityObjectPrototype::s_info = { "InspectorAuditAccessibilityObjectPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSInspectorAuditAccessibilityObjectPrototype) }; |
458 | |
459 | void JSInspectorAuditAccessibilityObjectPrototype::finishCreation(VM& vm) |
460 | { |
461 | Base::finishCreation(vm); |
462 | reifyStaticProperties(vm, JSInspectorAuditAccessibilityObject::info(), JSInspectorAuditAccessibilityObjectPrototypeTableValues, *this); |
463 | } |
464 | |
465 | const ClassInfo JSInspectorAuditAccessibilityObject::s_info = { "InspectorAuditAccessibilityObject" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSInspectorAuditAccessibilityObject) }; |
466 | |
467 | JSInspectorAuditAccessibilityObject::JSInspectorAuditAccessibilityObject(Structure* structure, JSDOMGlobalObject& globalObject, Ref<InspectorAuditAccessibilityObject>&& impl) |
468 | : JSDOMWrapper<InspectorAuditAccessibilityObject>(structure, globalObject, WTFMove(impl)) |
469 | { |
470 | } |
471 | |
472 | void JSInspectorAuditAccessibilityObject::finishCreation(VM& vm) |
473 | { |
474 | Base::finishCreation(vm); |
475 | ASSERT(inherits(vm, info())); |
476 | |
477 | } |
478 | |
479 | JSObject* JSInspectorAuditAccessibilityObject::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
480 | { |
481 | return JSInspectorAuditAccessibilityObjectPrototype::create(vm, &globalObject, JSInspectorAuditAccessibilityObjectPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype())); |
482 | } |
483 | |
484 | JSObject* JSInspectorAuditAccessibilityObject::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
485 | { |
486 | return getDOMPrototype<JSInspectorAuditAccessibilityObject>(vm, globalObject); |
487 | } |
488 | |
489 | void JSInspectorAuditAccessibilityObject::destroy(JSC::JSCell* cell) |
490 | { |
491 | JSInspectorAuditAccessibilityObject* thisObject = static_cast<JSInspectorAuditAccessibilityObject*>(cell); |
492 | thisObject->JSInspectorAuditAccessibilityObject::~JSInspectorAuditAccessibilityObject(); |
493 | } |
494 | |
495 | template<> inline JSInspectorAuditAccessibilityObject* IDLOperation<JSInspectorAuditAccessibilityObject>::cast(ExecState& state) |
496 | { |
497 | return jsDynamicCast<JSInspectorAuditAccessibilityObject*>(state.vm(), state.thisValue()); |
498 | } |
499 | |
500 | static inline JSC::EncodedJSValue jsInspectorAuditAccessibilityObjectPrototypeFunctionGetElementsByComputedRoleBody(JSC::ExecState* state, typename IDLOperation<JSInspectorAuditAccessibilityObject>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
501 | { |
502 | UNUSED_PARAM(state); |
503 | UNUSED_PARAM(throwScope); |
504 | auto& impl = castedThis->wrapped(); |
505 | if (UNLIKELY(state->argumentCount() < 1)) |
506 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
507 | auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext(); |
508 | if (UNLIKELY(!context)) |
509 | return JSValue::encode(jsUndefined()); |
510 | ASSERT(context->isDocument()); |
511 | auto& document = downcast<Document>(*context); |
512 | auto role = convert<IDLDOMString>(*state, state->uncheckedArgument(0)); |
513 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
514 | auto container = convert<IDLNullable<IDLInterface<Node>>>(*state, state->argument(1), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 1, "container" , "InspectorAuditAccessibilityObject" , "getElementsByComputedRole" , "Node" ); }); |
515 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
516 | return JSValue::encode(toJS<IDLSequence<IDLInterface<Node>>>(*state, *castedThis->globalObject(), throwScope, impl.getElementsByComputedRole(document, WTFMove(role), WTFMove(container)))); |
517 | } |
518 | |
519 | EncodedJSValue JSC_HOST_CALL jsInspectorAuditAccessibilityObjectPrototypeFunctionGetElementsByComputedRole(ExecState* state) |
520 | { |
521 | return IDLOperation<JSInspectorAuditAccessibilityObject>::call<jsInspectorAuditAccessibilityObjectPrototypeFunctionGetElementsByComputedRoleBody>(*state, "getElementsByComputedRole" ); |
522 | } |
523 | |
524 | static inline JSC::EncodedJSValue jsInspectorAuditAccessibilityObjectPrototypeFunctionGetActiveDescendantBody(JSC::ExecState* state, typename IDLOperation<JSInspectorAuditAccessibilityObject>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
525 | { |
526 | UNUSED_PARAM(state); |
527 | UNUSED_PARAM(throwScope); |
528 | auto& impl = castedThis->wrapped(); |
529 | if (UNLIKELY(state->argumentCount() < 1)) |
530 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
531 | auto node = convert<IDLInterface<Node>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "node" , "InspectorAuditAccessibilityObject" , "getActiveDescendant" , "Node" ); }); |
532 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
533 | return JSValue::encode(toJS<IDLNullable<IDLInterface<Node>>>(*state, *castedThis->globalObject(), throwScope, impl.getActiveDescendant(*node))); |
534 | } |
535 | |
536 | EncodedJSValue JSC_HOST_CALL jsInspectorAuditAccessibilityObjectPrototypeFunctionGetActiveDescendant(ExecState* state) |
537 | { |
538 | return IDLOperation<JSInspectorAuditAccessibilityObject>::call<jsInspectorAuditAccessibilityObjectPrototypeFunctionGetActiveDescendantBody>(*state, "getActiveDescendant" ); |
539 | } |
540 | |
541 | static inline JSC::EncodedJSValue jsInspectorAuditAccessibilityObjectPrototypeFunctionGetChildNodesBody(JSC::ExecState* state, typename IDLOperation<JSInspectorAuditAccessibilityObject>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
542 | { |
543 | UNUSED_PARAM(state); |
544 | UNUSED_PARAM(throwScope); |
545 | auto& impl = castedThis->wrapped(); |
546 | if (UNLIKELY(state->argumentCount() < 1)) |
547 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
548 | auto node = convert<IDLInterface<Node>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "node" , "InspectorAuditAccessibilityObject" , "getChildNodes" , "Node" ); }); |
549 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
550 | return JSValue::encode(toJS<IDLNullable<IDLSequence<IDLInterface<Node>>>>(*state, *castedThis->globalObject(), throwScope, impl.getChildNodes(*node))); |
551 | } |
552 | |
553 | EncodedJSValue JSC_HOST_CALL jsInspectorAuditAccessibilityObjectPrototypeFunctionGetChildNodes(ExecState* state) |
554 | { |
555 | return IDLOperation<JSInspectorAuditAccessibilityObject>::call<jsInspectorAuditAccessibilityObjectPrototypeFunctionGetChildNodesBody>(*state, "getChildNodes" ); |
556 | } |
557 | |
558 | static inline JSC::EncodedJSValue jsInspectorAuditAccessibilityObjectPrototypeFunctionGetComputedPropertiesBody(JSC::ExecState* state, typename IDLOperation<JSInspectorAuditAccessibilityObject>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
559 | { |
560 | UNUSED_PARAM(state); |
561 | UNUSED_PARAM(throwScope); |
562 | auto& impl = castedThis->wrapped(); |
563 | if (UNLIKELY(state->argumentCount() < 1)) |
564 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
565 | auto node = convert<IDLInterface<Node>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "node" , "InspectorAuditAccessibilityObject" , "getComputedProperties" , "Node" ); }); |
566 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
567 | return JSValue::encode(toJS<IDLNullable<IDLDictionary<InspectorAuditAccessibilityObject::ComputedProperties>>>(*state, *castedThis->globalObject(), throwScope, impl.getComputedProperties(*node))); |
568 | } |
569 | |
570 | EncodedJSValue JSC_HOST_CALL jsInspectorAuditAccessibilityObjectPrototypeFunctionGetComputedProperties(ExecState* state) |
571 | { |
572 | return IDLOperation<JSInspectorAuditAccessibilityObject>::call<jsInspectorAuditAccessibilityObjectPrototypeFunctionGetComputedPropertiesBody>(*state, "getComputedProperties" ); |
573 | } |
574 | |
575 | static inline JSC::EncodedJSValue jsInspectorAuditAccessibilityObjectPrototypeFunctionGetControlledNodesBody(JSC::ExecState* state, typename IDLOperation<JSInspectorAuditAccessibilityObject>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
576 | { |
577 | UNUSED_PARAM(state); |
578 | UNUSED_PARAM(throwScope); |
579 | auto& impl = castedThis->wrapped(); |
580 | if (UNLIKELY(state->argumentCount() < 1)) |
581 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
582 | auto node = convert<IDLInterface<Node>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "node" , "InspectorAuditAccessibilityObject" , "getControlledNodes" , "Node" ); }); |
583 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
584 | return JSValue::encode(toJS<IDLNullable<IDLSequence<IDLInterface<Node>>>>(*state, *castedThis->globalObject(), throwScope, impl.getControlledNodes(*node))); |
585 | } |
586 | |
587 | EncodedJSValue JSC_HOST_CALL jsInspectorAuditAccessibilityObjectPrototypeFunctionGetControlledNodes(ExecState* state) |
588 | { |
589 | return IDLOperation<JSInspectorAuditAccessibilityObject>::call<jsInspectorAuditAccessibilityObjectPrototypeFunctionGetControlledNodesBody>(*state, "getControlledNodes" ); |
590 | } |
591 | |
592 | static inline JSC::EncodedJSValue jsInspectorAuditAccessibilityObjectPrototypeFunctionGetFlowedNodesBody(JSC::ExecState* state, typename IDLOperation<JSInspectorAuditAccessibilityObject>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
593 | { |
594 | UNUSED_PARAM(state); |
595 | UNUSED_PARAM(throwScope); |
596 | auto& impl = castedThis->wrapped(); |
597 | if (UNLIKELY(state->argumentCount() < 1)) |
598 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
599 | auto node = convert<IDLInterface<Node>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "node" , "InspectorAuditAccessibilityObject" , "getFlowedNodes" , "Node" ); }); |
600 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
601 | return JSValue::encode(toJS<IDLNullable<IDLSequence<IDLInterface<Node>>>>(*state, *castedThis->globalObject(), throwScope, impl.getFlowedNodes(*node))); |
602 | } |
603 | |
604 | EncodedJSValue JSC_HOST_CALL jsInspectorAuditAccessibilityObjectPrototypeFunctionGetFlowedNodes(ExecState* state) |
605 | { |
606 | return IDLOperation<JSInspectorAuditAccessibilityObject>::call<jsInspectorAuditAccessibilityObjectPrototypeFunctionGetFlowedNodesBody>(*state, "getFlowedNodes" ); |
607 | } |
608 | |
609 | static inline JSC::EncodedJSValue jsInspectorAuditAccessibilityObjectPrototypeFunctionGetMouseEventNodeBody(JSC::ExecState* state, typename IDLOperation<JSInspectorAuditAccessibilityObject>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
610 | { |
611 | UNUSED_PARAM(state); |
612 | UNUSED_PARAM(throwScope); |
613 | auto& impl = castedThis->wrapped(); |
614 | if (UNLIKELY(state->argumentCount() < 1)) |
615 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
616 | auto node = convert<IDLInterface<Node>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "node" , "InspectorAuditAccessibilityObject" , "getMouseEventNode" , "Node" ); }); |
617 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
618 | return JSValue::encode(toJS<IDLNullable<IDLInterface<Node>>>(*state, *castedThis->globalObject(), throwScope, impl.getMouseEventNode(*node))); |
619 | } |
620 | |
621 | EncodedJSValue JSC_HOST_CALL jsInspectorAuditAccessibilityObjectPrototypeFunctionGetMouseEventNode(ExecState* state) |
622 | { |
623 | return IDLOperation<JSInspectorAuditAccessibilityObject>::call<jsInspectorAuditAccessibilityObjectPrototypeFunctionGetMouseEventNodeBody>(*state, "getMouseEventNode" ); |
624 | } |
625 | |
626 | static inline JSC::EncodedJSValue jsInspectorAuditAccessibilityObjectPrototypeFunctionGetOwnedNodesBody(JSC::ExecState* state, typename IDLOperation<JSInspectorAuditAccessibilityObject>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
627 | { |
628 | UNUSED_PARAM(state); |
629 | UNUSED_PARAM(throwScope); |
630 | auto& impl = castedThis->wrapped(); |
631 | if (UNLIKELY(state->argumentCount() < 1)) |
632 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
633 | auto node = convert<IDLInterface<Node>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "node" , "InspectorAuditAccessibilityObject" , "getOwnedNodes" , "Node" ); }); |
634 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
635 | return JSValue::encode(toJS<IDLNullable<IDLSequence<IDLInterface<Node>>>>(*state, *castedThis->globalObject(), throwScope, impl.getOwnedNodes(*node))); |
636 | } |
637 | |
638 | EncodedJSValue JSC_HOST_CALL jsInspectorAuditAccessibilityObjectPrototypeFunctionGetOwnedNodes(ExecState* state) |
639 | { |
640 | return IDLOperation<JSInspectorAuditAccessibilityObject>::call<jsInspectorAuditAccessibilityObjectPrototypeFunctionGetOwnedNodesBody>(*state, "getOwnedNodes" ); |
641 | } |
642 | |
643 | static inline JSC::EncodedJSValue jsInspectorAuditAccessibilityObjectPrototypeFunctionGetParentNodeBody(JSC::ExecState* state, typename IDLOperation<JSInspectorAuditAccessibilityObject>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
644 | { |
645 | UNUSED_PARAM(state); |
646 | UNUSED_PARAM(throwScope); |
647 | auto& impl = castedThis->wrapped(); |
648 | if (UNLIKELY(state->argumentCount() < 1)) |
649 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
650 | auto node = convert<IDLInterface<Node>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "node" , "InspectorAuditAccessibilityObject" , "getParentNode" , "Node" ); }); |
651 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
652 | return JSValue::encode(toJS<IDLNullable<IDLInterface<Node>>>(*state, *castedThis->globalObject(), throwScope, impl.getParentNode(*node))); |
653 | } |
654 | |
655 | EncodedJSValue JSC_HOST_CALL jsInspectorAuditAccessibilityObjectPrototypeFunctionGetParentNode(ExecState* state) |
656 | { |
657 | return IDLOperation<JSInspectorAuditAccessibilityObject>::call<jsInspectorAuditAccessibilityObjectPrototypeFunctionGetParentNodeBody>(*state, "getParentNode" ); |
658 | } |
659 | |
660 | static inline JSC::EncodedJSValue jsInspectorAuditAccessibilityObjectPrototypeFunctionGetSelectedChildNodesBody(JSC::ExecState* state, typename IDLOperation<JSInspectorAuditAccessibilityObject>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
661 | { |
662 | UNUSED_PARAM(state); |
663 | UNUSED_PARAM(throwScope); |
664 | auto& impl = castedThis->wrapped(); |
665 | if (UNLIKELY(state->argumentCount() < 1)) |
666 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
667 | auto node = convert<IDLInterface<Node>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "node" , "InspectorAuditAccessibilityObject" , "getSelectedChildNodes" , "Node" ); }); |
668 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
669 | return JSValue::encode(toJS<IDLNullable<IDLSequence<IDLInterface<Node>>>>(*state, *castedThis->globalObject(), throwScope, impl.getSelectedChildNodes(*node))); |
670 | } |
671 | |
672 | EncodedJSValue JSC_HOST_CALL jsInspectorAuditAccessibilityObjectPrototypeFunctionGetSelectedChildNodes(ExecState* state) |
673 | { |
674 | return IDLOperation<JSInspectorAuditAccessibilityObject>::call<jsInspectorAuditAccessibilityObjectPrototypeFunctionGetSelectedChildNodesBody>(*state, "getSelectedChildNodes" ); |
675 | } |
676 | |
677 | void JSInspectorAuditAccessibilityObject::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
678 | { |
679 | auto* thisObject = jsCast<JSInspectorAuditAccessibilityObject*>(cell); |
680 | builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
681 | if (thisObject->scriptExecutionContext()) |
682 | builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
683 | Base::heapSnapshot(cell, builder); |
684 | } |
685 | |
686 | bool JSInspectorAuditAccessibilityObjectOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) |
687 | { |
688 | UNUSED_PARAM(handle); |
689 | UNUSED_PARAM(visitor); |
690 | UNUSED_PARAM(reason); |
691 | return false; |
692 | } |
693 | |
694 | void JSInspectorAuditAccessibilityObjectOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) |
695 | { |
696 | auto* jsInspectorAuditAccessibilityObject = static_cast<JSInspectorAuditAccessibilityObject*>(handle.slot()->asCell()); |
697 | auto& world = *static_cast<DOMWrapperWorld*>(context); |
698 | uncacheWrapper(world, &jsInspectorAuditAccessibilityObject->wrapped(), jsInspectorAuditAccessibilityObject); |
699 | } |
700 | |
701 | JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<InspectorAuditAccessibilityObject>&& impl) |
702 | { |
703 | // If you hit this failure the interface definition has the ImplementationLacksVTable |
704 | // attribute. You should remove that attribute. If the class has subclasses |
705 | // that may be passed through this toJS() function you should use the SkipVTableValidation |
706 | // attribute to InspectorAuditAccessibilityObject. |
707 | static_assert(!std::is_polymorphic<InspectorAuditAccessibilityObject>::value, "InspectorAuditAccessibilityObject is polymorphic but the IDL claims it is not" ); |
708 | return createWrapper<InspectorAuditAccessibilityObject>(globalObject, WTFMove(impl)); |
709 | } |
710 | |
711 | JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, InspectorAuditAccessibilityObject& impl) |
712 | { |
713 | return wrap(state, globalObject, impl); |
714 | } |
715 | |
716 | InspectorAuditAccessibilityObject* JSInspectorAuditAccessibilityObject::toWrapped(JSC::VM& vm, JSC::JSValue value) |
717 | { |
718 | if (auto* wrapper = jsDynamicCast<JSInspectorAuditAccessibilityObject*>(vm, value)) |
719 | return &wrapper->wrapped(); |
720 | return nullptr; |
721 | } |
722 | |
723 | } |
724 | |