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 "JSHTMLLinkElement.h" |
23 | |
24 | #include "CustomElementReactionQueue.h" |
25 | #include "Document.h" |
26 | #include "HTMLNames.h" |
27 | #include "JSDOMAttribute.h" |
28 | #include "JSDOMBinding.h" |
29 | #include "JSDOMConstructorNotConstructable.h" |
30 | #include "JSDOMConvertBoolean.h" |
31 | #include "JSDOMConvertInterface.h" |
32 | #include "JSDOMConvertNullable.h" |
33 | #include "JSDOMConvertStrings.h" |
34 | #include "JSDOMExceptionHandling.h" |
35 | #include "JSDOMGlobalObject.h" |
36 | #include "JSDOMTokenList.h" |
37 | #include "JSDOMWrapperCache.h" |
38 | #include "JSStyleSheet.h" |
39 | #include "ScriptExecutionContext.h" |
40 | #include "Settings.h" |
41 | #include <JavaScriptCore/HeapSnapshotBuilder.h> |
42 | #include <JavaScriptCore/JSCInlines.h> |
43 | #include <wtf/GetPtr.h> |
44 | #include <wtf/PointerPreparations.h> |
45 | #include <wtf/URL.h> |
46 | |
47 | |
48 | namespace WebCore { |
49 | using namespace JSC; |
50 | |
51 | // Attributes |
52 | |
53 | JSC::EncodedJSValue jsHTMLLinkElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
54 | bool setJSHTMLLinkElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
55 | JSC::EncodedJSValue jsHTMLLinkElementDisabled(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
56 | bool setJSHTMLLinkElementDisabled(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
57 | JSC::EncodedJSValue jsHTMLLinkElementCharset(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
58 | bool setJSHTMLLinkElementCharset(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
59 | JSC::EncodedJSValue jsHTMLLinkElementHref(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
60 | bool setJSHTMLLinkElementHref(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
61 | JSC::EncodedJSValue jsHTMLLinkElementHreflang(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
62 | bool setJSHTMLLinkElementHreflang(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
63 | JSC::EncodedJSValue jsHTMLLinkElementMedia(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
64 | bool setJSHTMLLinkElementMedia(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
65 | JSC::EncodedJSValue jsHTMLLinkElementRel(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
66 | bool setJSHTMLLinkElementRel(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
67 | JSC::EncodedJSValue jsHTMLLinkElementRev(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
68 | bool setJSHTMLLinkElementRev(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
69 | JSC::EncodedJSValue jsHTMLLinkElementSizes(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
70 | bool setJSHTMLLinkElementSizes(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
71 | JSC::EncodedJSValue jsHTMLLinkElementTarget(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
72 | bool setJSHTMLLinkElementTarget(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
73 | JSC::EncodedJSValue jsHTMLLinkElementType(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
74 | bool setJSHTMLLinkElementType(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
75 | JSC::EncodedJSValue jsHTMLLinkElementAs(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
76 | bool setJSHTMLLinkElementAs(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
77 | JSC::EncodedJSValue jsHTMLLinkElementCrossOrigin(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
78 | bool setJSHTMLLinkElementCrossOrigin(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
79 | JSC::EncodedJSValue jsHTMLLinkElementImageSrcset(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
80 | bool setJSHTMLLinkElementImageSrcset(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
81 | JSC::EncodedJSValue jsHTMLLinkElementImageSizes(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
82 | bool setJSHTMLLinkElementImageSizes(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
83 | JSC::EncodedJSValue jsHTMLLinkElementSheet(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
84 | JSC::EncodedJSValue jsHTMLLinkElementRelList(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
85 | bool setJSHTMLLinkElementRelList(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
86 | JSC::EncodedJSValue jsHTMLLinkElementNonce(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
87 | bool setJSHTMLLinkElementNonce(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
88 | JSC::EncodedJSValue jsHTMLLinkElementIntegrity(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
89 | bool setJSHTMLLinkElementIntegrity(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
90 | |
91 | class JSHTMLLinkElementPrototype : public JSC::JSNonFinalObject { |
92 | public: |
93 | using Base = JSC::JSNonFinalObject; |
94 | static JSHTMLLinkElementPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
95 | { |
96 | JSHTMLLinkElementPrototype* ptr = new (NotNull, JSC::allocateCell<JSHTMLLinkElementPrototype>(vm.heap)) JSHTMLLinkElementPrototype(vm, globalObject, structure); |
97 | ptr->finishCreation(vm); |
98 | return ptr; |
99 | } |
100 | |
101 | DECLARE_INFO; |
102 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
103 | { |
104 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
105 | } |
106 | |
107 | private: |
108 | JSHTMLLinkElementPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
109 | : JSC::JSNonFinalObject(vm, structure) |
110 | { |
111 | } |
112 | |
113 | void finishCreation(JSC::VM&); |
114 | }; |
115 | |
116 | using JSHTMLLinkElementConstructor = JSDOMConstructorNotConstructable<JSHTMLLinkElement>; |
117 | |
118 | template<> JSValue JSHTMLLinkElementConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
119 | { |
120 | return JSHTMLElement::getConstructor(vm, &globalObject); |
121 | } |
122 | |
123 | template<> void JSHTMLLinkElementConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
124 | { |
125 | putDirect(vm, vm.propertyNames->prototype, JSHTMLLinkElement::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
126 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("HTMLLinkElement"_s )), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
127 | putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
128 | } |
129 | |
130 | template<> const ClassInfo JSHTMLLinkElementConstructor::s_info = { "HTMLLinkElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSHTMLLinkElementConstructor) }; |
131 | |
132 | /* Hash table for prototype */ |
133 | |
134 | static const HashTableValue JSHTMLLinkElementPrototypeTableValues[] = |
135 | { |
136 | { "constructor" , static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLLinkElementConstructor) } }, |
137 | { "disabled" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementDisabled), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLLinkElementDisabled) } }, |
138 | { "charset" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementCharset), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLLinkElementCharset) } }, |
139 | { "href" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementHref), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLLinkElementHref) } }, |
140 | { "hreflang" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementHreflang), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLLinkElementHreflang) } }, |
141 | { "media" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementMedia), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLLinkElementMedia) } }, |
142 | { "rel" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementRel), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLLinkElementRel) } }, |
143 | { "rev" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementRev), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLLinkElementRev) } }, |
144 | { "sizes" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementSizes), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLLinkElementSizes) } }, |
145 | { "target" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementTarget), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLLinkElementTarget) } }, |
146 | { "type" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementType), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLLinkElementType) } }, |
147 | { "as" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementAs), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLLinkElementAs) } }, |
148 | { "crossOrigin" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementCrossOrigin), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLLinkElementCrossOrigin) } }, |
149 | { "imageSrcset" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementImageSrcset), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLLinkElementImageSrcset) } }, |
150 | { "imageSizes" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementImageSizes), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLLinkElementImageSizes) } }, |
151 | { "sheet" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementSheet), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
152 | { "relList" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementRelList), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLLinkElementRelList) } }, |
153 | { "nonce" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementNonce), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLLinkElementNonce) } }, |
154 | { "integrity" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLLinkElementIntegrity), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLLinkElementIntegrity) } }, |
155 | }; |
156 | |
157 | const ClassInfo JSHTMLLinkElementPrototype::s_info = { "HTMLLinkElementPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSHTMLLinkElementPrototype) }; |
158 | |
159 | void JSHTMLLinkElementPrototype::finishCreation(VM& vm) |
160 | { |
161 | Base::finishCreation(vm); |
162 | reifyStaticProperties(vm, JSHTMLLinkElement::info(), JSHTMLLinkElementPrototypeTableValues, *this); |
163 | bool hasDisabledRuntimeProperties = false; |
164 | if (!downcast<Document>(jsCast<JSDOMGlobalObject*>(globalObject())->scriptExecutionContext())->settings().subresourceIntegrityEnabled()) { |
165 | hasDisabledRuntimeProperties = true; |
166 | auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("integrity" ), strlen("integrity" )); |
167 | VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); |
168 | JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName); |
169 | } |
170 | if (hasDisabledRuntimeProperties && structure()->isDictionary()) |
171 | flattenDictionaryObject(vm); |
172 | } |
173 | |
174 | const ClassInfo JSHTMLLinkElement::s_info = { "HTMLLinkElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSHTMLLinkElement) }; |
175 | |
176 | JSHTMLLinkElement::JSHTMLLinkElement(Structure* structure, JSDOMGlobalObject& globalObject, Ref<HTMLLinkElement>&& impl) |
177 | : JSHTMLElement(structure, globalObject, WTFMove(impl)) |
178 | { |
179 | } |
180 | |
181 | void JSHTMLLinkElement::finishCreation(VM& vm) |
182 | { |
183 | Base::finishCreation(vm); |
184 | ASSERT(inherits(vm, info())); |
185 | |
186 | } |
187 | |
188 | JSObject* JSHTMLLinkElement::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
189 | { |
190 | return JSHTMLLinkElementPrototype::create(vm, &globalObject, JSHTMLLinkElementPrototype::createStructure(vm, &globalObject, JSHTMLElement::prototype(vm, globalObject))); |
191 | } |
192 | |
193 | JSObject* JSHTMLLinkElement::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
194 | { |
195 | return getDOMPrototype<JSHTMLLinkElement>(vm, globalObject); |
196 | } |
197 | |
198 | JSValue JSHTMLLinkElement::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
199 | { |
200 | return getDOMConstructor<JSHTMLLinkElementConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
201 | } |
202 | |
203 | template<> inline JSHTMLLinkElement* IDLAttribute<JSHTMLLinkElement>::cast(ExecState& state, EncodedJSValue thisValue) |
204 | { |
205 | return jsDynamicCast<JSHTMLLinkElement*>(state.vm(), JSValue::decode(thisValue)); |
206 | } |
207 | |
208 | EncodedJSValue jsHTMLLinkElementConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
209 | { |
210 | VM& vm = state->vm(); |
211 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
212 | auto* prototype = jsDynamicCast<JSHTMLLinkElementPrototype*>(vm, JSValue::decode(thisValue)); |
213 | if (UNLIKELY(!prototype)) |
214 | return throwVMTypeError(state, throwScope); |
215 | return JSValue::encode(JSHTMLLinkElement::getConstructor(state->vm(), prototype->globalObject())); |
216 | } |
217 | |
218 | bool setJSHTMLLinkElementConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
219 | { |
220 | VM& vm = state->vm(); |
221 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
222 | auto* prototype = jsDynamicCast<JSHTMLLinkElementPrototype*>(vm, JSValue::decode(thisValue)); |
223 | if (UNLIKELY(!prototype)) { |
224 | throwVMTypeError(state, throwScope); |
225 | return false; |
226 | } |
227 | // Shadowing a built-in constructor |
228 | return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue)); |
229 | } |
230 | |
231 | static inline JSValue jsHTMLLinkElementDisabledGetter(ExecState& state, JSHTMLLinkElement& thisObject, ThrowScope& throwScope) |
232 | { |
233 | UNUSED_PARAM(throwScope); |
234 | UNUSED_PARAM(state); |
235 | auto& impl = thisObject.wrapped(); |
236 | JSValue result = toJS<IDLBoolean>(state, throwScope, impl.hasAttributeWithoutSynchronization(WebCore::HTMLNames::disabledAttr)); |
237 | return result; |
238 | } |
239 | |
240 | EncodedJSValue jsHTMLLinkElementDisabled(ExecState* state, EncodedJSValue thisValue, PropertyName) |
241 | { |
242 | return IDLAttribute<JSHTMLLinkElement>::get<jsHTMLLinkElementDisabledGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "disabled" ); |
243 | } |
244 | |
245 | static inline bool setJSHTMLLinkElementDisabledSetter(ExecState& state, JSHTMLLinkElement& thisObject, JSValue value, ThrowScope& throwScope) |
246 | { |
247 | UNUSED_PARAM(throwScope); |
248 | auto& impl = thisObject.wrapped(); |
249 | auto nativeValue = convert<IDLBoolean>(state, value); |
250 | RETURN_IF_EXCEPTION(throwScope, false); |
251 | AttributeSetter::call(state, throwScope, [&] { |
252 | return impl.setBooleanAttribute(WebCore::HTMLNames::disabledAttr, WTFMove(nativeValue)); |
253 | }); |
254 | return true; |
255 | } |
256 | |
257 | bool setJSHTMLLinkElementDisabled(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
258 | { |
259 | return IDLAttribute<JSHTMLLinkElement>::set<setJSHTMLLinkElementDisabledSetter>(*state, thisValue, encodedValue, "disabled" ); |
260 | } |
261 | |
262 | static inline JSValue jsHTMLLinkElementCharsetGetter(ExecState& state, JSHTMLLinkElement& thisObject, ThrowScope& throwScope) |
263 | { |
264 | UNUSED_PARAM(throwScope); |
265 | UNUSED_PARAM(state); |
266 | auto& impl = thisObject.wrapped(); |
267 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::charsetAttr)); |
268 | return result; |
269 | } |
270 | |
271 | EncodedJSValue jsHTMLLinkElementCharset(ExecState* state, EncodedJSValue thisValue, PropertyName) |
272 | { |
273 | return IDLAttribute<JSHTMLLinkElement>::get<jsHTMLLinkElementCharsetGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "charset" ); |
274 | } |
275 | |
276 | static inline bool setJSHTMLLinkElementCharsetSetter(ExecState& state, JSHTMLLinkElement& thisObject, JSValue value, ThrowScope& throwScope) |
277 | { |
278 | UNUSED_PARAM(throwScope); |
279 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
280 | auto& impl = thisObject.wrapped(); |
281 | auto nativeValue = convert<IDLDOMString>(state, value); |
282 | RETURN_IF_EXCEPTION(throwScope, false); |
283 | AttributeSetter::call(state, throwScope, [&] { |
284 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::charsetAttr, WTFMove(nativeValue)); |
285 | }); |
286 | return true; |
287 | } |
288 | |
289 | bool setJSHTMLLinkElementCharset(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
290 | { |
291 | return IDLAttribute<JSHTMLLinkElement>::set<setJSHTMLLinkElementCharsetSetter>(*state, thisValue, encodedValue, "charset" ); |
292 | } |
293 | |
294 | static inline JSValue jsHTMLLinkElementHrefGetter(ExecState& state, JSHTMLLinkElement& thisObject, ThrowScope& throwScope) |
295 | { |
296 | UNUSED_PARAM(throwScope); |
297 | UNUSED_PARAM(state); |
298 | auto& impl = thisObject.wrapped(); |
299 | JSValue result = toJS<IDLUSVString>(state, throwScope, impl.getURLAttribute(WebCore::HTMLNames::hrefAttr)); |
300 | return result; |
301 | } |
302 | |
303 | EncodedJSValue jsHTMLLinkElementHref(ExecState* state, EncodedJSValue thisValue, PropertyName) |
304 | { |
305 | return IDLAttribute<JSHTMLLinkElement>::get<jsHTMLLinkElementHrefGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "href" ); |
306 | } |
307 | |
308 | static inline bool setJSHTMLLinkElementHrefSetter(ExecState& state, JSHTMLLinkElement& thisObject, JSValue value, ThrowScope& throwScope) |
309 | { |
310 | UNUSED_PARAM(throwScope); |
311 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
312 | auto& impl = thisObject.wrapped(); |
313 | auto nativeValue = convert<IDLUSVString>(state, value); |
314 | RETURN_IF_EXCEPTION(throwScope, false); |
315 | AttributeSetter::call(state, throwScope, [&] { |
316 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::hrefAttr, WTFMove(nativeValue)); |
317 | }); |
318 | return true; |
319 | } |
320 | |
321 | bool setJSHTMLLinkElementHref(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
322 | { |
323 | return IDLAttribute<JSHTMLLinkElement>::set<setJSHTMLLinkElementHrefSetter>(*state, thisValue, encodedValue, "href" ); |
324 | } |
325 | |
326 | static inline JSValue jsHTMLLinkElementHreflangGetter(ExecState& state, JSHTMLLinkElement& thisObject, ThrowScope& throwScope) |
327 | { |
328 | UNUSED_PARAM(throwScope); |
329 | UNUSED_PARAM(state); |
330 | auto& impl = thisObject.wrapped(); |
331 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::hreflangAttr)); |
332 | return result; |
333 | } |
334 | |
335 | EncodedJSValue jsHTMLLinkElementHreflang(ExecState* state, EncodedJSValue thisValue, PropertyName) |
336 | { |
337 | return IDLAttribute<JSHTMLLinkElement>::get<jsHTMLLinkElementHreflangGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "hreflang" ); |
338 | } |
339 | |
340 | static inline bool setJSHTMLLinkElementHreflangSetter(ExecState& state, JSHTMLLinkElement& thisObject, JSValue value, ThrowScope& throwScope) |
341 | { |
342 | UNUSED_PARAM(throwScope); |
343 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
344 | auto& impl = thisObject.wrapped(); |
345 | auto nativeValue = convert<IDLDOMString>(state, value); |
346 | RETURN_IF_EXCEPTION(throwScope, false); |
347 | AttributeSetter::call(state, throwScope, [&] { |
348 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::hreflangAttr, WTFMove(nativeValue)); |
349 | }); |
350 | return true; |
351 | } |
352 | |
353 | bool setJSHTMLLinkElementHreflang(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
354 | { |
355 | return IDLAttribute<JSHTMLLinkElement>::set<setJSHTMLLinkElementHreflangSetter>(*state, thisValue, encodedValue, "hreflang" ); |
356 | } |
357 | |
358 | static inline JSValue jsHTMLLinkElementMediaGetter(ExecState& state, JSHTMLLinkElement& thisObject, ThrowScope& throwScope) |
359 | { |
360 | UNUSED_PARAM(throwScope); |
361 | UNUSED_PARAM(state); |
362 | auto& impl = thisObject.wrapped(); |
363 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::mediaAttr)); |
364 | return result; |
365 | } |
366 | |
367 | EncodedJSValue jsHTMLLinkElementMedia(ExecState* state, EncodedJSValue thisValue, PropertyName) |
368 | { |
369 | return IDLAttribute<JSHTMLLinkElement>::get<jsHTMLLinkElementMediaGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "media" ); |
370 | } |
371 | |
372 | static inline bool setJSHTMLLinkElementMediaSetter(ExecState& state, JSHTMLLinkElement& thisObject, JSValue value, ThrowScope& throwScope) |
373 | { |
374 | UNUSED_PARAM(throwScope); |
375 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
376 | auto& impl = thisObject.wrapped(); |
377 | auto nativeValue = convert<IDLDOMString>(state, value); |
378 | RETURN_IF_EXCEPTION(throwScope, false); |
379 | AttributeSetter::call(state, throwScope, [&] { |
380 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::mediaAttr, WTFMove(nativeValue)); |
381 | }); |
382 | return true; |
383 | } |
384 | |
385 | bool setJSHTMLLinkElementMedia(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
386 | { |
387 | return IDLAttribute<JSHTMLLinkElement>::set<setJSHTMLLinkElementMediaSetter>(*state, thisValue, encodedValue, "media" ); |
388 | } |
389 | |
390 | static inline JSValue jsHTMLLinkElementRelGetter(ExecState& state, JSHTMLLinkElement& thisObject, ThrowScope& throwScope) |
391 | { |
392 | UNUSED_PARAM(throwScope); |
393 | UNUSED_PARAM(state); |
394 | auto& impl = thisObject.wrapped(); |
395 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::relAttr)); |
396 | return result; |
397 | } |
398 | |
399 | EncodedJSValue jsHTMLLinkElementRel(ExecState* state, EncodedJSValue thisValue, PropertyName) |
400 | { |
401 | return IDLAttribute<JSHTMLLinkElement>::get<jsHTMLLinkElementRelGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "rel" ); |
402 | } |
403 | |
404 | static inline bool setJSHTMLLinkElementRelSetter(ExecState& state, JSHTMLLinkElement& thisObject, JSValue value, ThrowScope& throwScope) |
405 | { |
406 | UNUSED_PARAM(throwScope); |
407 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
408 | auto& impl = thisObject.wrapped(); |
409 | auto nativeValue = convert<IDLDOMString>(state, value); |
410 | RETURN_IF_EXCEPTION(throwScope, false); |
411 | AttributeSetter::call(state, throwScope, [&] { |
412 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::relAttr, WTFMove(nativeValue)); |
413 | }); |
414 | return true; |
415 | } |
416 | |
417 | bool setJSHTMLLinkElementRel(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
418 | { |
419 | return IDLAttribute<JSHTMLLinkElement>::set<setJSHTMLLinkElementRelSetter>(*state, thisValue, encodedValue, "rel" ); |
420 | } |
421 | |
422 | static inline JSValue jsHTMLLinkElementRevGetter(ExecState& state, JSHTMLLinkElement& thisObject, ThrowScope& throwScope) |
423 | { |
424 | UNUSED_PARAM(throwScope); |
425 | UNUSED_PARAM(state); |
426 | auto& impl = thisObject.wrapped(); |
427 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::revAttr)); |
428 | return result; |
429 | } |
430 | |
431 | EncodedJSValue jsHTMLLinkElementRev(ExecState* state, EncodedJSValue thisValue, PropertyName) |
432 | { |
433 | return IDLAttribute<JSHTMLLinkElement>::get<jsHTMLLinkElementRevGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "rev" ); |
434 | } |
435 | |
436 | static inline bool setJSHTMLLinkElementRevSetter(ExecState& state, JSHTMLLinkElement& thisObject, JSValue value, ThrowScope& throwScope) |
437 | { |
438 | UNUSED_PARAM(throwScope); |
439 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
440 | auto& impl = thisObject.wrapped(); |
441 | auto nativeValue = convert<IDLDOMString>(state, value); |
442 | RETURN_IF_EXCEPTION(throwScope, false); |
443 | AttributeSetter::call(state, throwScope, [&] { |
444 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::revAttr, WTFMove(nativeValue)); |
445 | }); |
446 | return true; |
447 | } |
448 | |
449 | bool setJSHTMLLinkElementRev(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
450 | { |
451 | return IDLAttribute<JSHTMLLinkElement>::set<setJSHTMLLinkElementRevSetter>(*state, thisValue, encodedValue, "rev" ); |
452 | } |
453 | |
454 | static inline JSValue jsHTMLLinkElementSizesGetter(ExecState& state, JSHTMLLinkElement& thisObject, ThrowScope& throwScope) |
455 | { |
456 | UNUSED_PARAM(throwScope); |
457 | UNUSED_PARAM(state); |
458 | auto& impl = thisObject.wrapped(); |
459 | JSValue result = toJS<IDLInterface<DOMTokenList>>(state, *thisObject.globalObject(), throwScope, impl.sizes()); |
460 | return result; |
461 | } |
462 | |
463 | EncodedJSValue jsHTMLLinkElementSizes(ExecState* state, EncodedJSValue thisValue, PropertyName) |
464 | { |
465 | return IDLAttribute<JSHTMLLinkElement>::get<jsHTMLLinkElementSizesGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "sizes" ); |
466 | } |
467 | |
468 | static inline bool setJSHTMLLinkElementSizesSetter(ExecState& state, JSHTMLLinkElement& thisObject, JSValue value, ThrowScope& throwScope) |
469 | { |
470 | UNUSED_PARAM(throwScope); |
471 | auto id = Identifier::fromString(&state.vm(), reinterpret_cast<const LChar*>("sizes" ), strlen("sizes" )); |
472 | auto valueToForwardTo = thisObject.get(&state, id); |
473 | RETURN_IF_EXCEPTION(throwScope, false); |
474 | if (UNLIKELY(!valueToForwardTo.isObject())) { |
475 | throwTypeError(&state, throwScope); |
476 | return false; |
477 | } |
478 | auto forwardId = Identifier::fromString(&state.vm(), reinterpret_cast<const LChar*>("value" ), strlen("value" )); |
479 | PutPropertySlot slot(valueToForwardTo, false); |
480 | asObject(valueToForwardTo)->methodTable(state.vm())->put(asObject(valueToForwardTo), &state, forwardId, value, slot); |
481 | RETURN_IF_EXCEPTION(throwScope, false); |
482 | return true; |
483 | } |
484 | |
485 | bool setJSHTMLLinkElementSizes(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
486 | { |
487 | return IDLAttribute<JSHTMLLinkElement>::set<setJSHTMLLinkElementSizesSetter>(*state, thisValue, encodedValue, "sizes" ); |
488 | } |
489 | |
490 | static inline JSValue jsHTMLLinkElementTargetGetter(ExecState& state, JSHTMLLinkElement& thisObject, ThrowScope& throwScope) |
491 | { |
492 | UNUSED_PARAM(throwScope); |
493 | UNUSED_PARAM(state); |
494 | auto& impl = thisObject.wrapped(); |
495 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::targetAttr)); |
496 | return result; |
497 | } |
498 | |
499 | EncodedJSValue jsHTMLLinkElementTarget(ExecState* state, EncodedJSValue thisValue, PropertyName) |
500 | { |
501 | return IDLAttribute<JSHTMLLinkElement>::get<jsHTMLLinkElementTargetGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "target" ); |
502 | } |
503 | |
504 | static inline bool setJSHTMLLinkElementTargetSetter(ExecState& state, JSHTMLLinkElement& thisObject, JSValue value, ThrowScope& throwScope) |
505 | { |
506 | UNUSED_PARAM(throwScope); |
507 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
508 | auto& impl = thisObject.wrapped(); |
509 | auto nativeValue = convert<IDLDOMString>(state, value); |
510 | RETURN_IF_EXCEPTION(throwScope, false); |
511 | AttributeSetter::call(state, throwScope, [&] { |
512 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::targetAttr, WTFMove(nativeValue)); |
513 | }); |
514 | return true; |
515 | } |
516 | |
517 | bool setJSHTMLLinkElementTarget(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
518 | { |
519 | return IDLAttribute<JSHTMLLinkElement>::set<setJSHTMLLinkElementTargetSetter>(*state, thisValue, encodedValue, "target" ); |
520 | } |
521 | |
522 | static inline JSValue jsHTMLLinkElementTypeGetter(ExecState& state, JSHTMLLinkElement& thisObject, ThrowScope& throwScope) |
523 | { |
524 | UNUSED_PARAM(throwScope); |
525 | UNUSED_PARAM(state); |
526 | auto& impl = thisObject.wrapped(); |
527 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::typeAttr)); |
528 | return result; |
529 | } |
530 | |
531 | EncodedJSValue jsHTMLLinkElementType(ExecState* state, EncodedJSValue thisValue, PropertyName) |
532 | { |
533 | return IDLAttribute<JSHTMLLinkElement>::get<jsHTMLLinkElementTypeGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "type" ); |
534 | } |
535 | |
536 | static inline bool setJSHTMLLinkElementTypeSetter(ExecState& state, JSHTMLLinkElement& thisObject, JSValue value, ThrowScope& throwScope) |
537 | { |
538 | UNUSED_PARAM(throwScope); |
539 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
540 | auto& impl = thisObject.wrapped(); |
541 | auto nativeValue = convert<IDLDOMString>(state, value); |
542 | RETURN_IF_EXCEPTION(throwScope, false); |
543 | AttributeSetter::call(state, throwScope, [&] { |
544 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::typeAttr, WTFMove(nativeValue)); |
545 | }); |
546 | return true; |
547 | } |
548 | |
549 | bool setJSHTMLLinkElementType(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
550 | { |
551 | return IDLAttribute<JSHTMLLinkElement>::set<setJSHTMLLinkElementTypeSetter>(*state, thisValue, encodedValue, "type" ); |
552 | } |
553 | |
554 | static inline JSValue jsHTMLLinkElementAsGetter(ExecState& state, JSHTMLLinkElement& thisObject, ThrowScope& throwScope) |
555 | { |
556 | UNUSED_PARAM(throwScope); |
557 | UNUSED_PARAM(state); |
558 | auto& impl = thisObject.wrapped(); |
559 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.as()); |
560 | return result; |
561 | } |
562 | |
563 | EncodedJSValue jsHTMLLinkElementAs(ExecState* state, EncodedJSValue thisValue, PropertyName) |
564 | { |
565 | return IDLAttribute<JSHTMLLinkElement>::get<jsHTMLLinkElementAsGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "as" ); |
566 | } |
567 | |
568 | static inline bool setJSHTMLLinkElementAsSetter(ExecState& state, JSHTMLLinkElement& thisObject, JSValue value, ThrowScope& throwScope) |
569 | { |
570 | UNUSED_PARAM(throwScope); |
571 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
572 | auto& impl = thisObject.wrapped(); |
573 | auto nativeValue = convert<IDLDOMString>(state, value); |
574 | RETURN_IF_EXCEPTION(throwScope, false); |
575 | AttributeSetter::call(state, throwScope, [&] { |
576 | return impl.setAs(WTFMove(nativeValue)); |
577 | }); |
578 | return true; |
579 | } |
580 | |
581 | bool setJSHTMLLinkElementAs(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
582 | { |
583 | return IDLAttribute<JSHTMLLinkElement>::set<setJSHTMLLinkElementAsSetter>(*state, thisValue, encodedValue, "as" ); |
584 | } |
585 | |
586 | static inline JSValue jsHTMLLinkElementCrossOriginGetter(ExecState& state, JSHTMLLinkElement& thisObject, ThrowScope& throwScope) |
587 | { |
588 | UNUSED_PARAM(throwScope); |
589 | UNUSED_PARAM(state); |
590 | auto& impl = thisObject.wrapped(); |
591 | JSValue result = toJS<IDLNullable<IDLDOMString>>(state, throwScope, impl.crossOrigin()); |
592 | return result; |
593 | } |
594 | |
595 | EncodedJSValue jsHTMLLinkElementCrossOrigin(ExecState* state, EncodedJSValue thisValue, PropertyName) |
596 | { |
597 | return IDLAttribute<JSHTMLLinkElement>::get<jsHTMLLinkElementCrossOriginGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "crossOrigin" ); |
598 | } |
599 | |
600 | static inline bool setJSHTMLLinkElementCrossOriginSetter(ExecState& state, JSHTMLLinkElement& thisObject, JSValue value, ThrowScope& throwScope) |
601 | { |
602 | UNUSED_PARAM(throwScope); |
603 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
604 | auto& impl = thisObject.wrapped(); |
605 | auto nativeValue = convert<IDLNullable<IDLDOMString>>(state, value); |
606 | RETURN_IF_EXCEPTION(throwScope, false); |
607 | AttributeSetter::call(state, throwScope, [&] { |
608 | return impl.setCrossOrigin(WTFMove(nativeValue)); |
609 | }); |
610 | return true; |
611 | } |
612 | |
613 | bool setJSHTMLLinkElementCrossOrigin(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
614 | { |
615 | return IDLAttribute<JSHTMLLinkElement>::set<setJSHTMLLinkElementCrossOriginSetter>(*state, thisValue, encodedValue, "crossOrigin" ); |
616 | } |
617 | |
618 | static inline JSValue jsHTMLLinkElementImageSrcsetGetter(ExecState& state, JSHTMLLinkElement& thisObject, ThrowScope& throwScope) |
619 | { |
620 | UNUSED_PARAM(throwScope); |
621 | UNUSED_PARAM(state); |
622 | auto& impl = thisObject.wrapped(); |
623 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::imagesrcsetAttr)); |
624 | return result; |
625 | } |
626 | |
627 | EncodedJSValue jsHTMLLinkElementImageSrcset(ExecState* state, EncodedJSValue thisValue, PropertyName) |
628 | { |
629 | return IDLAttribute<JSHTMLLinkElement>::get<jsHTMLLinkElementImageSrcsetGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "imageSrcset" ); |
630 | } |
631 | |
632 | static inline bool setJSHTMLLinkElementImageSrcsetSetter(ExecState& state, JSHTMLLinkElement& thisObject, JSValue value, ThrowScope& throwScope) |
633 | { |
634 | UNUSED_PARAM(throwScope); |
635 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
636 | auto& impl = thisObject.wrapped(); |
637 | auto nativeValue = convert<IDLDOMString>(state, value); |
638 | RETURN_IF_EXCEPTION(throwScope, false); |
639 | AttributeSetter::call(state, throwScope, [&] { |
640 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::imagesrcsetAttr, WTFMove(nativeValue)); |
641 | }); |
642 | return true; |
643 | } |
644 | |
645 | bool setJSHTMLLinkElementImageSrcset(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
646 | { |
647 | return IDLAttribute<JSHTMLLinkElement>::set<setJSHTMLLinkElementImageSrcsetSetter>(*state, thisValue, encodedValue, "imageSrcset" ); |
648 | } |
649 | |
650 | static inline JSValue jsHTMLLinkElementImageSizesGetter(ExecState& state, JSHTMLLinkElement& thisObject, ThrowScope& throwScope) |
651 | { |
652 | UNUSED_PARAM(throwScope); |
653 | UNUSED_PARAM(state); |
654 | auto& impl = thisObject.wrapped(); |
655 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::imagesizesAttr)); |
656 | return result; |
657 | } |
658 | |
659 | EncodedJSValue jsHTMLLinkElementImageSizes(ExecState* state, EncodedJSValue thisValue, PropertyName) |
660 | { |
661 | return IDLAttribute<JSHTMLLinkElement>::get<jsHTMLLinkElementImageSizesGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "imageSizes" ); |
662 | } |
663 | |
664 | static inline bool setJSHTMLLinkElementImageSizesSetter(ExecState& state, JSHTMLLinkElement& thisObject, JSValue value, ThrowScope& throwScope) |
665 | { |
666 | UNUSED_PARAM(throwScope); |
667 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
668 | auto& impl = thisObject.wrapped(); |
669 | auto nativeValue = convert<IDLDOMString>(state, value); |
670 | RETURN_IF_EXCEPTION(throwScope, false); |
671 | AttributeSetter::call(state, throwScope, [&] { |
672 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::imagesizesAttr, WTFMove(nativeValue)); |
673 | }); |
674 | return true; |
675 | } |
676 | |
677 | bool setJSHTMLLinkElementImageSizes(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
678 | { |
679 | return IDLAttribute<JSHTMLLinkElement>::set<setJSHTMLLinkElementImageSizesSetter>(*state, thisValue, encodedValue, "imageSizes" ); |
680 | } |
681 | |
682 | static inline JSValue jsHTMLLinkElementSheetGetter(ExecState& state, JSHTMLLinkElement& thisObject, ThrowScope& throwScope) |
683 | { |
684 | UNUSED_PARAM(throwScope); |
685 | UNUSED_PARAM(state); |
686 | auto& impl = thisObject.wrapped(); |
687 | JSValue result = toJS<IDLInterface<StyleSheet>>(state, *thisObject.globalObject(), throwScope, impl.sheet()); |
688 | return result; |
689 | } |
690 | |
691 | EncodedJSValue jsHTMLLinkElementSheet(ExecState* state, EncodedJSValue thisValue, PropertyName) |
692 | { |
693 | return IDLAttribute<JSHTMLLinkElement>::get<jsHTMLLinkElementSheetGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "sheet" ); |
694 | } |
695 | |
696 | static inline JSValue jsHTMLLinkElementRelListGetter(ExecState& state, JSHTMLLinkElement& thisObject, ThrowScope& throwScope) |
697 | { |
698 | UNUSED_PARAM(throwScope); |
699 | UNUSED_PARAM(state); |
700 | auto& impl = thisObject.wrapped(); |
701 | JSValue result = toJS<IDLInterface<DOMTokenList>>(state, *thisObject.globalObject(), throwScope, impl.relList()); |
702 | return result; |
703 | } |
704 | |
705 | EncodedJSValue jsHTMLLinkElementRelList(ExecState* state, EncodedJSValue thisValue, PropertyName) |
706 | { |
707 | return IDLAttribute<JSHTMLLinkElement>::get<jsHTMLLinkElementRelListGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "relList" ); |
708 | } |
709 | |
710 | static inline bool setJSHTMLLinkElementRelListSetter(ExecState& state, JSHTMLLinkElement& thisObject, JSValue value, ThrowScope& throwScope) |
711 | { |
712 | UNUSED_PARAM(throwScope); |
713 | auto id = Identifier::fromString(&state.vm(), reinterpret_cast<const LChar*>("relList" ), strlen("relList" )); |
714 | auto valueToForwardTo = thisObject.get(&state, id); |
715 | RETURN_IF_EXCEPTION(throwScope, false); |
716 | if (UNLIKELY(!valueToForwardTo.isObject())) { |
717 | throwTypeError(&state, throwScope); |
718 | return false; |
719 | } |
720 | auto forwardId = Identifier::fromString(&state.vm(), reinterpret_cast<const LChar*>("value" ), strlen("value" )); |
721 | PutPropertySlot slot(valueToForwardTo, false); |
722 | asObject(valueToForwardTo)->methodTable(state.vm())->put(asObject(valueToForwardTo), &state, forwardId, value, slot); |
723 | RETURN_IF_EXCEPTION(throwScope, false); |
724 | return true; |
725 | } |
726 | |
727 | bool setJSHTMLLinkElementRelList(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
728 | { |
729 | return IDLAttribute<JSHTMLLinkElement>::set<setJSHTMLLinkElementRelListSetter>(*state, thisValue, encodedValue, "relList" ); |
730 | } |
731 | |
732 | static inline JSValue jsHTMLLinkElementNonceGetter(ExecState& state, JSHTMLLinkElement& thisObject, ThrowScope& throwScope) |
733 | { |
734 | UNUSED_PARAM(throwScope); |
735 | UNUSED_PARAM(state); |
736 | auto& impl = thisObject.wrapped(); |
737 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::nonceAttr)); |
738 | return result; |
739 | } |
740 | |
741 | EncodedJSValue jsHTMLLinkElementNonce(ExecState* state, EncodedJSValue thisValue, PropertyName) |
742 | { |
743 | return IDLAttribute<JSHTMLLinkElement>::get<jsHTMLLinkElementNonceGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "nonce" ); |
744 | } |
745 | |
746 | static inline bool setJSHTMLLinkElementNonceSetter(ExecState& state, JSHTMLLinkElement& thisObject, JSValue value, ThrowScope& throwScope) |
747 | { |
748 | UNUSED_PARAM(throwScope); |
749 | auto& impl = thisObject.wrapped(); |
750 | auto nativeValue = convert<IDLDOMString>(state, value); |
751 | RETURN_IF_EXCEPTION(throwScope, false); |
752 | AttributeSetter::call(state, throwScope, [&] { |
753 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::nonceAttr, WTFMove(nativeValue)); |
754 | }); |
755 | return true; |
756 | } |
757 | |
758 | bool setJSHTMLLinkElementNonce(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
759 | { |
760 | return IDLAttribute<JSHTMLLinkElement>::set<setJSHTMLLinkElementNonceSetter>(*state, thisValue, encodedValue, "nonce" ); |
761 | } |
762 | |
763 | static inline JSValue jsHTMLLinkElementIntegrityGetter(ExecState& state, JSHTMLLinkElement& thisObject, ThrowScope& throwScope) |
764 | { |
765 | UNUSED_PARAM(throwScope); |
766 | UNUSED_PARAM(state); |
767 | auto& impl = thisObject.wrapped(); |
768 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::integrityAttr)); |
769 | return result; |
770 | } |
771 | |
772 | EncodedJSValue jsHTMLLinkElementIntegrity(ExecState* state, EncodedJSValue thisValue, PropertyName) |
773 | { |
774 | return IDLAttribute<JSHTMLLinkElement>::get<jsHTMLLinkElementIntegrityGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "integrity" ); |
775 | } |
776 | |
777 | static inline bool setJSHTMLLinkElementIntegritySetter(ExecState& state, JSHTMLLinkElement& thisObject, JSValue value, ThrowScope& throwScope) |
778 | { |
779 | UNUSED_PARAM(throwScope); |
780 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
781 | auto& impl = thisObject.wrapped(); |
782 | auto nativeValue = convert<IDLDOMString>(state, value); |
783 | RETURN_IF_EXCEPTION(throwScope, false); |
784 | AttributeSetter::call(state, throwScope, [&] { |
785 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::integrityAttr, WTFMove(nativeValue)); |
786 | }); |
787 | return true; |
788 | } |
789 | |
790 | bool setJSHTMLLinkElementIntegrity(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
791 | { |
792 | return IDLAttribute<JSHTMLLinkElement>::set<setJSHTMLLinkElementIntegritySetter>(*state, thisValue, encodedValue, "integrity" ); |
793 | } |
794 | |
795 | void JSHTMLLinkElement::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
796 | { |
797 | auto* thisObject = jsCast<JSHTMLLinkElement*>(cell); |
798 | builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
799 | if (thisObject->scriptExecutionContext()) |
800 | builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
801 | Base::heapSnapshot(cell, builder); |
802 | } |
803 | |
804 | HTMLLinkElement* JSHTMLLinkElement::toWrapped(JSC::VM& vm, JSC::JSValue value) |
805 | { |
806 | if (auto* wrapper = jsDynamicCast<JSHTMLLinkElement*>(vm, value)) |
807 | return &wrapper->wrapped(); |
808 | return nullptr; |
809 | } |
810 | |
811 | } |
812 | |