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
23#if ENABLE(VIDEO)
24
25#include "JSHTMLMediaElement.h"
26
27#include "CustomElementReactionQueue.h"
28#include "Document.h"
29#include "EventNames.h"
30#include "HTMLNames.h"
31#include "JSBlob.h"
32#include "JSDOMAttribute.h"
33#include "JSDOMBinding.h"
34#include "JSDOMConstructorNotConstructable.h"
35#include "JSDOMConvertBoolean.h"
36#include "JSDOMConvertDate.h"
37#include "JSDOMConvertInterface.h"
38#include "JSDOMConvertNullable.h"
39#include "JSDOMConvertNumbers.h"
40#include "JSDOMConvertStrings.h"
41#include "JSDOMConvertUnion.h"
42#include "JSDOMExceptionHandling.h"
43#include "JSDOMGlobalObject.h"
44#include "JSDOMOperation.h"
45#include "JSDOMOperationReturningPromise.h"
46#include "JSDOMWrapperCache.h"
47#include "JSMediaController.h"
48#include "JSMediaError.h"
49#include "JSMediaSource.h"
50#include "JSMediaStream.h"
51#include "JSTimeRanges.h"
52#include "JSVideoPlaybackQuality.h"
53#include "Quirks.h"
54#include "RuntimeEnabledFeatures.h"
55#include "ScriptExecutionContext.h"
56#include <JavaScriptCore/HeapSnapshotBuilder.h>
57#include <JavaScriptCore/JSCInlines.h>
58#include <wtf/GetPtr.h>
59#include <wtf/PointerPreparations.h>
60#include <wtf/URL.h>
61#include <wtf/Variant.h>
62
63#if ENABLE(ENCRYPTED_MEDIA)
64#include "JSEventListener.h"
65#include "JSMediaKeys.h"
66#endif
67
68#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
69#include "JSWebKitMediaKeys.h"
70#endif
71
72#if ENABLE(MEDIA_SESSION) && ENABLE(VIDEO)
73#include "HTMLMediaElementMediaSession.h"
74#include "JSMediaSession.h"
75#endif
76
77#if ENABLE(VIDEO_TRACK)
78#include "JSAudioTrackList.h"
79#include "JSTextTrack.h"
80#include "JSTextTrackList.h"
81#include "JSVideoTrackList.h"
82#endif
83
84
85namespace WebCore {
86using namespace JSC;
87
88// Functions
89
90JSC::EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionLoad(JSC::ExecState*);
91JSC::EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionCanPlayType(JSC::ExecState*);
92JSC::EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionGetStartDate(JSC::ExecState*);
93JSC::EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionPlay(JSC::ExecState*);
94JSC::EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionPause(JSC::ExecState*);
95JSC::EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionFastSeek(JSC::ExecState*);
96#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
97JSC::EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionWebkitSetMediaKeys(JSC::ExecState*);
98#endif
99#if ENABLE(ENCRYPTED_MEDIA)
100JSC::EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionSetMediaKeys(JSC::ExecState*);
101#endif
102#if ENABLE(VIDEO_TRACK)
103JSC::EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionAddTextTrack(JSC::ExecState*);
104#endif
105JSC::EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionGetVideoPlaybackQuality(JSC::ExecState*);
106#if ENABLE(WIRELESS_PLAYBACK_TARGET)
107JSC::EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionWebkitShowPlaybackTargetPicker(JSC::ExecState*);
108#endif
109
110// Attributes
111
112JSC::EncodedJSValue jsHTMLMediaElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
113bool setJSHTMLMediaElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
114JSC::EncodedJSValue jsHTMLMediaElementError(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
115JSC::EncodedJSValue jsHTMLMediaElementSrc(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
116bool setJSHTMLMediaElementSrc(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
117JSC::EncodedJSValue jsHTMLMediaElementSrcObject(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
118bool setJSHTMLMediaElementSrcObject(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
119JSC::EncodedJSValue jsHTMLMediaElementCurrentSrc(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
120JSC::EncodedJSValue jsHTMLMediaElementCrossOrigin(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
121bool setJSHTMLMediaElementCrossOrigin(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
122JSC::EncodedJSValue jsHTMLMediaElementNetworkState(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
123JSC::EncodedJSValue jsHTMLMediaElementPreload(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
124bool setJSHTMLMediaElementPreload(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
125JSC::EncodedJSValue jsHTMLMediaElementBuffered(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
126JSC::EncodedJSValue jsHTMLMediaElementReadyState(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
127JSC::EncodedJSValue jsHTMLMediaElementSeeking(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
128JSC::EncodedJSValue jsHTMLMediaElementCurrentTime(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
129bool setJSHTMLMediaElementCurrentTime(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
130JSC::EncodedJSValue jsHTMLMediaElementDuration(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
131JSC::EncodedJSValue jsHTMLMediaElementPaused(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
132JSC::EncodedJSValue jsHTMLMediaElementDefaultPlaybackRate(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
133bool setJSHTMLMediaElementDefaultPlaybackRate(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
134JSC::EncodedJSValue jsHTMLMediaElementPlaybackRate(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
135bool setJSHTMLMediaElementPlaybackRate(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
136JSC::EncodedJSValue jsHTMLMediaElementPlayed(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
137JSC::EncodedJSValue jsHTMLMediaElementSeekable(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
138JSC::EncodedJSValue jsHTMLMediaElementEnded(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
139JSC::EncodedJSValue jsHTMLMediaElementAutoplay(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
140bool setJSHTMLMediaElementAutoplay(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
141JSC::EncodedJSValue jsHTMLMediaElementLoop(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
142bool setJSHTMLMediaElementLoop(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
143JSC::EncodedJSValue jsHTMLMediaElementControls(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
144bool setJSHTMLMediaElementControls(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
145JSC::EncodedJSValue jsHTMLMediaElementVolume(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
146bool setJSHTMLMediaElementVolume(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
147JSC::EncodedJSValue jsHTMLMediaElementMuted(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
148bool setJSHTMLMediaElementMuted(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
149JSC::EncodedJSValue jsHTMLMediaElementDefaultMuted(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
150bool setJSHTMLMediaElementDefaultMuted(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
151JSC::EncodedJSValue jsHTMLMediaElementWebkitPreservesPitch(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
152bool setJSHTMLMediaElementWebkitPreservesPitch(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
153JSC::EncodedJSValue jsHTMLMediaElementWebkitHasClosedCaptions(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
154JSC::EncodedJSValue jsHTMLMediaElementWebkitClosedCaptionsVisible(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
155bool setJSHTMLMediaElementWebkitClosedCaptionsVisible(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
156#if ENABLE(MEDIA_STATISTICS)
157JSC::EncodedJSValue jsHTMLMediaElementWebkitAudioDecodedByteCount(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
158#endif
159#if ENABLE(MEDIA_STATISTICS)
160JSC::EncodedJSValue jsHTMLMediaElementWebkitVideoDecodedByteCount(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
161#endif
162#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
163JSC::EncodedJSValue jsHTMLMediaElementWebkitKeys(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
164#endif
165#if ENABLE(ENCRYPTED_MEDIA)
166JSC::EncodedJSValue jsHTMLMediaElementMediaKeys(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
167#endif
168#if ENABLE(ENCRYPTED_MEDIA)
169JSC::EncodedJSValue jsHTMLMediaElementOnencrypted(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
170bool setJSHTMLMediaElementOnencrypted(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
171#endif
172#if ENABLE(ENCRYPTED_MEDIA)
173JSC::EncodedJSValue jsHTMLMediaElementOnwaitingforkey(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
174bool setJSHTMLMediaElementOnwaitingforkey(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
175#endif
176#if ENABLE(VIDEO_TRACK)
177JSC::EncodedJSValue jsHTMLMediaElementAudioTracks(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
178#endif
179#if ENABLE(VIDEO_TRACK)
180JSC::EncodedJSValue jsHTMLMediaElementTextTracks(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
181#endif
182#if ENABLE(VIDEO_TRACK)
183JSC::EncodedJSValue jsHTMLMediaElementVideoTracks(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
184#endif
185JSC::EncodedJSValue jsHTMLMediaElementMediaGroup(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
186bool setJSHTMLMediaElementMediaGroup(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
187JSC::EncodedJSValue jsHTMLMediaElementController(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
188bool setJSHTMLMediaElementController(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
189#if ENABLE(WIRELESS_PLAYBACK_TARGET)
190JSC::EncodedJSValue jsHTMLMediaElementWebkitCurrentPlaybackTargetIsWireless(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
191#endif
192#if ENABLE(MEDIA_SESSION) && ENABLE(VIDEO)
193JSC::EncodedJSValue jsHTMLMediaElementKind(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
194bool setJSHTMLMediaElementKind(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
195#endif
196#if ENABLE(MEDIA_SESSION) && ENABLE(VIDEO)
197JSC::EncodedJSValue jsHTMLMediaElementSession(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
198bool setJSHTMLMediaElementSession(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
199#endif
200
201class JSHTMLMediaElementPrototype : public JSC::JSNonFinalObject {
202public:
203 using Base = JSC::JSNonFinalObject;
204 static JSHTMLMediaElementPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
205 {
206 JSHTMLMediaElementPrototype* ptr = new (NotNull, JSC::allocateCell<JSHTMLMediaElementPrototype>(vm.heap)) JSHTMLMediaElementPrototype(vm, globalObject, structure);
207 ptr->finishCreation(vm);
208 return ptr;
209 }
210
211 DECLARE_INFO;
212 static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
213 {
214 return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
215 }
216
217private:
218 JSHTMLMediaElementPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
219 : JSC::JSNonFinalObject(vm, structure)
220 {
221 }
222
223 void finishCreation(JSC::VM&);
224};
225
226using JSHTMLMediaElementConstructor = JSDOMConstructorNotConstructable<JSHTMLMediaElement>;
227
228/* Hash table for constructor */
229
230static const HashTableValue JSHTMLMediaElementConstructorTableValues[] =
231{
232 { "NETWORK_EMPTY", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0) } },
233 { "NETWORK_IDLE", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(1) } },
234 { "NETWORK_LOADING", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(2) } },
235 { "NETWORK_NO_SOURCE", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(3) } },
236 { "HAVE_NOTHING", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0) } },
237 { "HAVE_METADATA", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(1) } },
238 { "HAVE_CURRENT_DATA", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(2) } },
239 { "HAVE_FUTURE_DATA", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(3) } },
240 { "HAVE_ENOUGH_DATA", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(4) } },
241};
242
243static_assert(HTMLMediaElement::NETWORK_EMPTY == 0, "NETWORK_EMPTY in HTMLMediaElement does not match value from IDL");
244static_assert(HTMLMediaElement::NETWORK_IDLE == 1, "NETWORK_IDLE in HTMLMediaElement does not match value from IDL");
245static_assert(HTMLMediaElement::NETWORK_LOADING == 2, "NETWORK_LOADING in HTMLMediaElement does not match value from IDL");
246static_assert(HTMLMediaElement::NETWORK_NO_SOURCE == 3, "NETWORK_NO_SOURCE in HTMLMediaElement does not match value from IDL");
247static_assert(HTMLMediaElement::HAVE_NOTHING == 0, "HAVE_NOTHING in HTMLMediaElement does not match value from IDL");
248static_assert(HTMLMediaElement::HAVE_METADATA == 1, "HAVE_METADATA in HTMLMediaElement does not match value from IDL");
249static_assert(HTMLMediaElement::HAVE_CURRENT_DATA == 2, "HAVE_CURRENT_DATA in HTMLMediaElement does not match value from IDL");
250static_assert(HTMLMediaElement::HAVE_FUTURE_DATA == 3, "HAVE_FUTURE_DATA in HTMLMediaElement does not match value from IDL");
251static_assert(HTMLMediaElement::HAVE_ENOUGH_DATA == 4, "HAVE_ENOUGH_DATA in HTMLMediaElement does not match value from IDL");
252
253template<> JSValue JSHTMLMediaElementConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
254{
255 return JSHTMLElement::getConstructor(vm, &globalObject);
256}
257
258template<> void JSHTMLMediaElementConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
259{
260 putDirect(vm, vm.propertyNames->prototype, JSHTMLMediaElement::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
261 putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("HTMLMediaElement"_s)), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
262 putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
263 reifyStaticProperties(vm, JSHTMLMediaElement::info(), JSHTMLMediaElementConstructorTableValues, *this);
264}
265
266template<> const ClassInfo JSHTMLMediaElementConstructor::s_info = { "HTMLMediaElement", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSHTMLMediaElementConstructor) };
267
268/* Hash table for prototype */
269
270static const HashTableValue JSHTMLMediaElementPrototypeTableValues[] =
271{
272 { "constructor", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLMediaElementConstructor) } },
273 { "error", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementError), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
274 { "src", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementSrc), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLMediaElementSrc) } },
275 { "srcObject", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementSrcObject), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLMediaElementSrcObject) } },
276 { "currentSrc", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementCurrentSrc), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
277 { "crossOrigin", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementCrossOrigin), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLMediaElementCrossOrigin) } },
278 { "networkState", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementNetworkState), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
279 { "preload", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementPreload), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLMediaElementPreload) } },
280 { "buffered", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementBuffered), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
281 { "readyState", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementReadyState), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
282 { "seeking", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementSeeking), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
283 { "currentTime", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementCurrentTime), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLMediaElementCurrentTime) } },
284 { "duration", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementDuration), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
285 { "paused", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementPaused), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
286 { "defaultPlaybackRate", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementDefaultPlaybackRate), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLMediaElementDefaultPlaybackRate) } },
287 { "playbackRate", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementPlaybackRate), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLMediaElementPlaybackRate) } },
288 { "played", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementPlayed), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
289 { "seekable", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementSeekable), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
290 { "ended", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementEnded), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
291 { "autoplay", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementAutoplay), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLMediaElementAutoplay) } },
292 { "loop", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementLoop), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLMediaElementLoop) } },
293 { "controls", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementControls), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLMediaElementControls) } },
294 { "volume", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementVolume), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLMediaElementVolume) } },
295 { "muted", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementMuted), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLMediaElementMuted) } },
296 { "defaultMuted", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementDefaultMuted), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLMediaElementDefaultMuted) } },
297 { "webkitPreservesPitch", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementWebkitPreservesPitch), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLMediaElementWebkitPreservesPitch) } },
298 { "webkitHasClosedCaptions", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementWebkitHasClosedCaptions), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
299 { "webkitClosedCaptionsVisible", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementWebkitClosedCaptionsVisible), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLMediaElementWebkitClosedCaptionsVisible) } },
300#if ENABLE(MEDIA_STATISTICS)
301 { "webkitAudioDecodedByteCount", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementWebkitAudioDecodedByteCount), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
302#else
303 { 0, 0, NoIntrinsic, { 0, 0 } },
304#endif
305#if ENABLE(MEDIA_STATISTICS)
306 { "webkitVideoDecodedByteCount", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementWebkitVideoDecodedByteCount), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
307#else
308 { 0, 0, NoIntrinsic, { 0, 0 } },
309#endif
310#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
311 { "webkitKeys", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementWebkitKeys), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
312#else
313 { 0, 0, NoIntrinsic, { 0, 0 } },
314#endif
315#if ENABLE(ENCRYPTED_MEDIA)
316 { "mediaKeys", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementMediaKeys), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
317#else
318 { 0, 0, NoIntrinsic, { 0, 0 } },
319#endif
320#if ENABLE(ENCRYPTED_MEDIA)
321 { "onencrypted", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementOnencrypted), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLMediaElementOnencrypted) } },
322#else
323 { 0, 0, NoIntrinsic, { 0, 0 } },
324#endif
325#if ENABLE(ENCRYPTED_MEDIA)
326 { "onwaitingforkey", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementOnwaitingforkey), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLMediaElementOnwaitingforkey) } },
327#else
328 { 0, 0, NoIntrinsic, { 0, 0 } },
329#endif
330#if ENABLE(VIDEO_TRACK)
331 { "audioTracks", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementAudioTracks), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
332#else
333 { 0, 0, NoIntrinsic, { 0, 0 } },
334#endif
335#if ENABLE(VIDEO_TRACK)
336 { "textTracks", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementTextTracks), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
337#else
338 { 0, 0, NoIntrinsic, { 0, 0 } },
339#endif
340#if ENABLE(VIDEO_TRACK)
341 { "videoTracks", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementVideoTracks), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
342#else
343 { 0, 0, NoIntrinsic, { 0, 0 } },
344#endif
345 { "mediaGroup", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementMediaGroup), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLMediaElementMediaGroup) } },
346 { "controller", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementController), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLMediaElementController) } },
347#if ENABLE(WIRELESS_PLAYBACK_TARGET)
348 { "webkitCurrentPlaybackTargetIsWireless", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementWebkitCurrentPlaybackTargetIsWireless), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
349#else
350 { 0, 0, NoIntrinsic, { 0, 0 } },
351#endif
352#if ENABLE(MEDIA_SESSION) && ENABLE(VIDEO)
353 { "kind", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementKind), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLMediaElementKind) } },
354#else
355 { 0, 0, NoIntrinsic, { 0, 0 } },
356#endif
357#if ENABLE(MEDIA_SESSION) && ENABLE(VIDEO)
358 { "session", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementSession), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLMediaElementSession) } },
359#else
360 { 0, 0, NoIntrinsic, { 0, 0 } },
361#endif
362 { "load", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLMediaElementPrototypeFunctionLoad), (intptr_t) (0) } },
363 { "canPlayType", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLMediaElementPrototypeFunctionCanPlayType), (intptr_t) (1) } },
364 { "getStartDate", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLMediaElementPrototypeFunctionGetStartDate), (intptr_t) (0) } },
365 { "play", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLMediaElementPrototypeFunctionPlay), (intptr_t) (0) } },
366 { "pause", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLMediaElementPrototypeFunctionPause), (intptr_t) (0) } },
367 { "fastSeek", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLMediaElementPrototypeFunctionFastSeek), (intptr_t) (1) } },
368#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
369 { "webkitSetMediaKeys", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLMediaElementPrototypeFunctionWebkitSetMediaKeys), (intptr_t) (1) } },
370#else
371 { 0, 0, NoIntrinsic, { 0, 0 } },
372#endif
373#if ENABLE(ENCRYPTED_MEDIA)
374 { "setMediaKeys", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLMediaElementPrototypeFunctionSetMediaKeys), (intptr_t) (1) } },
375#else
376 { 0, 0, NoIntrinsic, { 0, 0 } },
377#endif
378#if ENABLE(VIDEO_TRACK)
379 { "addTextTrack", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLMediaElementPrototypeFunctionAddTextTrack), (intptr_t) (1) } },
380#else
381 { 0, 0, NoIntrinsic, { 0, 0 } },
382#endif
383 { "getVideoPlaybackQuality", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLMediaElementPrototypeFunctionGetVideoPlaybackQuality), (intptr_t) (0) } },
384#if ENABLE(WIRELESS_PLAYBACK_TARGET)
385 { "webkitShowPlaybackTargetPicker", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLMediaElementPrototypeFunctionWebkitShowPlaybackTargetPicker), (intptr_t) (0) } },
386#else
387 { 0, 0, NoIntrinsic, { 0, 0 } },
388#endif
389 { "NETWORK_EMPTY", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0) } },
390 { "NETWORK_IDLE", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(1) } },
391 { "NETWORK_LOADING", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(2) } },
392 { "NETWORK_NO_SOURCE", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(3) } },
393 { "HAVE_NOTHING", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0) } },
394 { "HAVE_METADATA", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(1) } },
395 { "HAVE_CURRENT_DATA", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(2) } },
396 { "HAVE_FUTURE_DATA", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(3) } },
397 { "HAVE_ENOUGH_DATA", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(4) } },
398};
399
400const ClassInfo JSHTMLMediaElementPrototype::s_info = { "HTMLMediaElementPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSHTMLMediaElementPrototype) };
401
402void JSHTMLMediaElementPrototype::finishCreation(VM& vm)
403{
404 Base::finishCreation(vm);
405 reifyStaticProperties(vm, JSHTMLMediaElement::info(), JSHTMLMediaElementPrototypeTableValues, *this);
406 bool hasDisabledRuntimeProperties = false;
407#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
408 if (!RuntimeEnabledFeatures::sharedFeatures().legacyEncryptedMediaAPIEnabled()) {
409 hasDisabledRuntimeProperties = true;
410 auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("webkitSetMediaKeys"), strlen("webkitSetMediaKeys"));
411 VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable);
412 JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName);
413 }
414#endif
415#if ENABLE(ENCRYPTED_MEDIA)
416 if (!(!downcast<Document>(jsCast<JSDOMGlobalObject*>(globalObject())->scriptExecutionContext())->quirks().hasBrokenEncryptedMediaAPISupportQuirk() && RuntimeEnabledFeatures::sharedFeatures().encryptedMediaAPIEnabled())) {
417 hasDisabledRuntimeProperties = true;
418 auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("setMediaKeys"), strlen("setMediaKeys"));
419 VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable);
420 JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName);
421 }
422#endif
423#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
424 if (!RuntimeEnabledFeatures::sharedFeatures().legacyEncryptedMediaAPIEnabled()) {
425 hasDisabledRuntimeProperties = true;
426 auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("webkitKeys"), strlen("webkitKeys"));
427 VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable);
428 JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName);
429 }
430#endif
431#if ENABLE(ENCRYPTED_MEDIA)
432 if (!(!downcast<Document>(jsCast<JSDOMGlobalObject*>(globalObject())->scriptExecutionContext())->quirks().hasBrokenEncryptedMediaAPISupportQuirk() && RuntimeEnabledFeatures::sharedFeatures().encryptedMediaAPIEnabled())) {
433 hasDisabledRuntimeProperties = true;
434 auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("mediaKeys"), strlen("mediaKeys"));
435 VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable);
436 JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName);
437 }
438#endif
439#if ENABLE(ENCRYPTED_MEDIA)
440 if (!(!downcast<Document>(jsCast<JSDOMGlobalObject*>(globalObject())->scriptExecutionContext())->quirks().hasBrokenEncryptedMediaAPISupportQuirk() && RuntimeEnabledFeatures::sharedFeatures().encryptedMediaAPIEnabled())) {
441 hasDisabledRuntimeProperties = true;
442 auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("onencrypted"), strlen("onencrypted"));
443 VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable);
444 JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName);
445 }
446#endif
447#if ENABLE(ENCRYPTED_MEDIA)
448 if (!(!downcast<Document>(jsCast<JSDOMGlobalObject*>(globalObject())->scriptExecutionContext())->quirks().hasBrokenEncryptedMediaAPISupportQuirk() && RuntimeEnabledFeatures::sharedFeatures().encryptedMediaAPIEnabled())) {
449 hasDisabledRuntimeProperties = true;
450 auto propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>("onwaitingforkey"), strlen("onwaitingforkey"));
451 VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable);
452 JSObject::deleteProperty(this, globalObject()->globalExec(), propertyName);
453 }
454#endif
455 if (hasDisabledRuntimeProperties && structure()->isDictionary())
456 flattenDictionaryObject(vm);
457}
458
459const ClassInfo JSHTMLMediaElement::s_info = { "HTMLMediaElement", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSHTMLMediaElement) };
460
461JSHTMLMediaElement::JSHTMLMediaElement(Structure* structure, JSDOMGlobalObject& globalObject, Ref<HTMLMediaElement>&& impl)
462 : JSHTMLElement(structure, globalObject, WTFMove(impl))
463{
464}
465
466void JSHTMLMediaElement::finishCreation(VM& vm)
467{
468 Base::finishCreation(vm);
469 ASSERT(inherits(vm, info()));
470
471}
472
473JSObject* JSHTMLMediaElement::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
474{
475 return JSHTMLMediaElementPrototype::create(vm, &globalObject, JSHTMLMediaElementPrototype::createStructure(vm, &globalObject, JSHTMLElement::prototype(vm, globalObject)));
476}
477
478JSObject* JSHTMLMediaElement::prototype(VM& vm, JSDOMGlobalObject& globalObject)
479{
480 return getDOMPrototype<JSHTMLMediaElement>(vm, globalObject);
481}
482
483JSValue JSHTMLMediaElement::getConstructor(VM& vm, const JSGlobalObject* globalObject)
484{
485 return getDOMConstructor<JSHTMLMediaElementConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
486}
487
488template<> inline JSHTMLMediaElement* IDLAttribute<JSHTMLMediaElement>::cast(ExecState& state, EncodedJSValue thisValue)
489{
490 return jsDynamicCast<JSHTMLMediaElement*>(state.vm(), JSValue::decode(thisValue));
491}
492
493template<> inline JSHTMLMediaElement* IDLOperation<JSHTMLMediaElement>::cast(ExecState& state)
494{
495 return jsDynamicCast<JSHTMLMediaElement*>(state.vm(), state.thisValue());
496}
497
498EncodedJSValue jsHTMLMediaElementConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
499{
500 VM& vm = state->vm();
501 auto throwScope = DECLARE_THROW_SCOPE(vm);
502 auto* prototype = jsDynamicCast<JSHTMLMediaElementPrototype*>(vm, JSValue::decode(thisValue));
503 if (UNLIKELY(!prototype))
504 return throwVMTypeError(state, throwScope);
505 return JSValue::encode(JSHTMLMediaElement::getConstructor(state->vm(), prototype->globalObject()));
506}
507
508bool setJSHTMLMediaElementConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
509{
510 VM& vm = state->vm();
511 auto throwScope = DECLARE_THROW_SCOPE(vm);
512 auto* prototype = jsDynamicCast<JSHTMLMediaElementPrototype*>(vm, JSValue::decode(thisValue));
513 if (UNLIKELY(!prototype)) {
514 throwVMTypeError(state, throwScope);
515 return false;
516 }
517 // Shadowing a built-in constructor
518 return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue));
519}
520
521static inline JSValue jsHTMLMediaElementErrorGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
522{
523 UNUSED_PARAM(throwScope);
524 UNUSED_PARAM(state);
525 auto& impl = thisObject.wrapped();
526 JSValue result = toJS<IDLInterface<MediaError>>(state, *thisObject.globalObject(), throwScope, impl.error());
527 return result;
528}
529
530EncodedJSValue jsHTMLMediaElementError(ExecState* state, EncodedJSValue thisValue, PropertyName)
531{
532 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementErrorGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "error");
533}
534
535static inline JSValue jsHTMLMediaElementSrcGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
536{
537 UNUSED_PARAM(throwScope);
538 UNUSED_PARAM(state);
539 auto& impl = thisObject.wrapped();
540 JSValue result = toJS<IDLUSVString>(state, throwScope, impl.getURLAttribute(WebCore::HTMLNames::srcAttr));
541 return result;
542}
543
544EncodedJSValue jsHTMLMediaElementSrc(ExecState* state, EncodedJSValue thisValue, PropertyName)
545{
546 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementSrcGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "src");
547}
548
549static inline bool setJSHTMLMediaElementSrcSetter(ExecState& state, JSHTMLMediaElement& thisObject, JSValue value, ThrowScope& throwScope)
550{
551 UNUSED_PARAM(throwScope);
552 CustomElementReactionDisallowedScope customElementReactionDisallowedScope;
553 auto& impl = thisObject.wrapped();
554 auto nativeValue = convert<IDLUSVString>(state, value);
555 RETURN_IF_EXCEPTION(throwScope, false);
556 AttributeSetter::call(state, throwScope, [&] {
557 return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::srcAttr, WTFMove(nativeValue));
558 });
559 return true;
560}
561
562bool setJSHTMLMediaElementSrc(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
563{
564 return IDLAttribute<JSHTMLMediaElement>::set<setJSHTMLMediaElementSrcSetter>(*state, thisValue, encodedValue, "src");
565}
566
567static inline JSValue jsHTMLMediaElementSrcObjectGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
568{
569 UNUSED_PARAM(throwScope);
570 UNUSED_PARAM(state);
571 auto& impl = thisObject.wrapped();
572 JSValue result = toJS<IDLNullable<IDLUnion<IDLInterface<MediaStream>, IDLInterface<MediaSource>, IDLInterface<Blob>>>>(state, *thisObject.globalObject(), throwScope, impl.srcObject());
573 return result;
574}
575
576EncodedJSValue jsHTMLMediaElementSrcObject(ExecState* state, EncodedJSValue thisValue, PropertyName)
577{
578 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementSrcObjectGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "srcObject");
579}
580
581static inline bool setJSHTMLMediaElementSrcObjectSetter(ExecState& state, JSHTMLMediaElement& thisObject, JSValue value, ThrowScope& throwScope)
582{
583 UNUSED_PARAM(throwScope);
584 auto& impl = thisObject.wrapped();
585 auto nativeValue = convert<IDLNullable<IDLUnion<IDLInterface<MediaStream>, IDLInterface<MediaSource>, IDLInterface<Blob>>>>(state, value);
586 RETURN_IF_EXCEPTION(throwScope, false);
587 AttributeSetter::call(state, throwScope, [&] {
588 return impl.setSrcObject(WTFMove(nativeValue));
589 });
590 return true;
591}
592
593bool setJSHTMLMediaElementSrcObject(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
594{
595 return IDLAttribute<JSHTMLMediaElement>::set<setJSHTMLMediaElementSrcObjectSetter>(*state, thisValue, encodedValue, "srcObject");
596}
597
598static inline JSValue jsHTMLMediaElementCurrentSrcGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
599{
600 UNUSED_PARAM(throwScope);
601 UNUSED_PARAM(state);
602 auto& impl = thisObject.wrapped();
603 JSValue result = toJS<IDLUSVString>(state, throwScope, impl.currentSrc());
604 return result;
605}
606
607EncodedJSValue jsHTMLMediaElementCurrentSrc(ExecState* state, EncodedJSValue thisValue, PropertyName)
608{
609 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementCurrentSrcGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "currentSrc");
610}
611
612static inline JSValue jsHTMLMediaElementCrossOriginGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
613{
614 UNUSED_PARAM(throwScope);
615 UNUSED_PARAM(state);
616 auto& impl = thisObject.wrapped();
617 JSValue result = toJS<IDLNullable<IDLDOMString>>(state, throwScope, impl.crossOrigin());
618 return result;
619}
620
621EncodedJSValue jsHTMLMediaElementCrossOrigin(ExecState* state, EncodedJSValue thisValue, PropertyName)
622{
623 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementCrossOriginGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "crossOrigin");
624}
625
626static inline bool setJSHTMLMediaElementCrossOriginSetter(ExecState& state, JSHTMLMediaElement& thisObject, JSValue value, ThrowScope& throwScope)
627{
628 UNUSED_PARAM(throwScope);
629 CustomElementReactionDisallowedScope customElementReactionDisallowedScope;
630 auto& impl = thisObject.wrapped();
631 auto nativeValue = convert<IDLNullable<IDLDOMString>>(state, value);
632 RETURN_IF_EXCEPTION(throwScope, false);
633 AttributeSetter::call(state, throwScope, [&] {
634 return impl.setCrossOrigin(WTFMove(nativeValue));
635 });
636 return true;
637}
638
639bool setJSHTMLMediaElementCrossOrigin(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
640{
641 return IDLAttribute<JSHTMLMediaElement>::set<setJSHTMLMediaElementCrossOriginSetter>(*state, thisValue, encodedValue, "crossOrigin");
642}
643
644static inline JSValue jsHTMLMediaElementNetworkStateGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
645{
646 UNUSED_PARAM(throwScope);
647 UNUSED_PARAM(state);
648 auto& impl = thisObject.wrapped();
649 JSValue result = toJS<IDLUnsignedShort>(state, throwScope, impl.networkState());
650 return result;
651}
652
653EncodedJSValue jsHTMLMediaElementNetworkState(ExecState* state, EncodedJSValue thisValue, PropertyName)
654{
655 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementNetworkStateGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "networkState");
656}
657
658static inline JSValue jsHTMLMediaElementPreloadGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
659{
660 UNUSED_PARAM(throwScope);
661 UNUSED_PARAM(state);
662 auto& impl = thisObject.wrapped();
663 JSValue result = toJS<IDLDOMString>(state, throwScope, impl.preload());
664 return result;
665}
666
667EncodedJSValue jsHTMLMediaElementPreload(ExecState* state, EncodedJSValue thisValue, PropertyName)
668{
669 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementPreloadGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "preload");
670}
671
672static inline bool setJSHTMLMediaElementPreloadSetter(ExecState& state, JSHTMLMediaElement& thisObject, JSValue value, ThrowScope& throwScope)
673{
674 UNUSED_PARAM(throwScope);
675 CustomElementReactionDisallowedScope customElementReactionDisallowedScope;
676 auto& impl = thisObject.wrapped();
677 auto nativeValue = convert<IDLDOMString>(state, value);
678 RETURN_IF_EXCEPTION(throwScope, false);
679 AttributeSetter::call(state, throwScope, [&] {
680 return impl.setPreload(WTFMove(nativeValue));
681 });
682 return true;
683}
684
685bool setJSHTMLMediaElementPreload(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
686{
687 return IDLAttribute<JSHTMLMediaElement>::set<setJSHTMLMediaElementPreloadSetter>(*state, thisValue, encodedValue, "preload");
688}
689
690static inline JSValue jsHTMLMediaElementBufferedGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
691{
692 UNUSED_PARAM(throwScope);
693 UNUSED_PARAM(state);
694 auto& impl = thisObject.wrapped();
695 JSValue result = toJS<IDLInterface<TimeRanges>>(state, *thisObject.globalObject(), throwScope, impl.buffered());
696 return result;
697}
698
699EncodedJSValue jsHTMLMediaElementBuffered(ExecState* state, EncodedJSValue thisValue, PropertyName)
700{
701 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementBufferedGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "buffered");
702}
703
704static inline JSValue jsHTMLMediaElementReadyStateGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
705{
706 UNUSED_PARAM(throwScope);
707 UNUSED_PARAM(state);
708 auto& impl = thisObject.wrapped();
709 JSValue result = toJS<IDLUnsignedShort>(state, throwScope, impl.readyState());
710 return result;
711}
712
713EncodedJSValue jsHTMLMediaElementReadyState(ExecState* state, EncodedJSValue thisValue, PropertyName)
714{
715 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementReadyStateGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "readyState");
716}
717
718static inline JSValue jsHTMLMediaElementSeekingGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
719{
720 UNUSED_PARAM(throwScope);
721 UNUSED_PARAM(state);
722 auto& impl = thisObject.wrapped();
723 JSValue result = toJS<IDLBoolean>(state, throwScope, impl.seeking());
724 return result;
725}
726
727EncodedJSValue jsHTMLMediaElementSeeking(ExecState* state, EncodedJSValue thisValue, PropertyName)
728{
729 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementSeekingGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "seeking");
730}
731
732static inline JSValue jsHTMLMediaElementCurrentTimeGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
733{
734 UNUSED_PARAM(throwScope);
735 UNUSED_PARAM(state);
736 auto& impl = thisObject.wrapped();
737 JSValue result = toJS<IDLUnrestrictedDouble>(state, throwScope, impl.currentTimeForBindings());
738 return result;
739}
740
741EncodedJSValue jsHTMLMediaElementCurrentTime(ExecState* state, EncodedJSValue thisValue, PropertyName)
742{
743 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementCurrentTimeGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "currentTime");
744}
745
746static inline bool setJSHTMLMediaElementCurrentTimeSetter(ExecState& state, JSHTMLMediaElement& thisObject, JSValue value, ThrowScope& throwScope)
747{
748 UNUSED_PARAM(throwScope);
749 auto& impl = thisObject.wrapped();
750 auto nativeValue = convert<IDLUnrestrictedDouble>(state, value);
751 RETURN_IF_EXCEPTION(throwScope, false);
752 AttributeSetter::call(state, throwScope, [&] {
753 return impl.setCurrentTimeForBindings(WTFMove(nativeValue));
754 });
755 return true;
756}
757
758bool setJSHTMLMediaElementCurrentTime(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
759{
760 return IDLAttribute<JSHTMLMediaElement>::set<setJSHTMLMediaElementCurrentTimeSetter>(*state, thisValue, encodedValue, "currentTime");
761}
762
763static inline JSValue jsHTMLMediaElementDurationGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
764{
765 UNUSED_PARAM(throwScope);
766 UNUSED_PARAM(state);
767 auto& impl = thisObject.wrapped();
768 JSValue result = toJS<IDLUnrestrictedDouble>(state, throwScope, impl.duration());
769 return result;
770}
771
772EncodedJSValue jsHTMLMediaElementDuration(ExecState* state, EncodedJSValue thisValue, PropertyName)
773{
774 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementDurationGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "duration");
775}
776
777static inline JSValue jsHTMLMediaElementPausedGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
778{
779 UNUSED_PARAM(throwScope);
780 UNUSED_PARAM(state);
781 auto& impl = thisObject.wrapped();
782 JSValue result = toJS<IDLBoolean>(state, throwScope, impl.paused());
783 return result;
784}
785
786EncodedJSValue jsHTMLMediaElementPaused(ExecState* state, EncodedJSValue thisValue, PropertyName)
787{
788 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementPausedGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "paused");
789}
790
791static inline JSValue jsHTMLMediaElementDefaultPlaybackRateGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
792{
793 UNUSED_PARAM(throwScope);
794 UNUSED_PARAM(state);
795 auto& impl = thisObject.wrapped();
796 JSValue result = toJS<IDLUnrestrictedDouble>(state, throwScope, impl.defaultPlaybackRate());
797 return result;
798}
799
800EncodedJSValue jsHTMLMediaElementDefaultPlaybackRate(ExecState* state, EncodedJSValue thisValue, PropertyName)
801{
802 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementDefaultPlaybackRateGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "defaultPlaybackRate");
803}
804
805static inline bool setJSHTMLMediaElementDefaultPlaybackRateSetter(ExecState& state, JSHTMLMediaElement& thisObject, JSValue value, ThrowScope& throwScope)
806{
807 UNUSED_PARAM(throwScope);
808 auto& impl = thisObject.wrapped();
809 auto nativeValue = convert<IDLUnrestrictedDouble>(state, value);
810 RETURN_IF_EXCEPTION(throwScope, false);
811 AttributeSetter::call(state, throwScope, [&] {
812 return impl.setDefaultPlaybackRate(WTFMove(nativeValue));
813 });
814 return true;
815}
816
817bool setJSHTMLMediaElementDefaultPlaybackRate(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
818{
819 return IDLAttribute<JSHTMLMediaElement>::set<setJSHTMLMediaElementDefaultPlaybackRateSetter>(*state, thisValue, encodedValue, "defaultPlaybackRate");
820}
821
822static inline JSValue jsHTMLMediaElementPlaybackRateGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
823{
824 UNUSED_PARAM(throwScope);
825 UNUSED_PARAM(state);
826 auto& impl = thisObject.wrapped();
827 JSValue result = toJS<IDLUnrestrictedDouble>(state, throwScope, impl.playbackRate());
828 return result;
829}
830
831EncodedJSValue jsHTMLMediaElementPlaybackRate(ExecState* state, EncodedJSValue thisValue, PropertyName)
832{
833 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementPlaybackRateGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "playbackRate");
834}
835
836static inline bool setJSHTMLMediaElementPlaybackRateSetter(ExecState& state, JSHTMLMediaElement& thisObject, JSValue value, ThrowScope& throwScope)
837{
838 UNUSED_PARAM(throwScope);
839 auto& impl = thisObject.wrapped();
840 auto nativeValue = convert<IDLUnrestrictedDouble>(state, value);
841 RETURN_IF_EXCEPTION(throwScope, false);
842 AttributeSetter::call(state, throwScope, [&] {
843 return impl.setPlaybackRate(WTFMove(nativeValue));
844 });
845 return true;
846}
847
848bool setJSHTMLMediaElementPlaybackRate(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
849{
850 return IDLAttribute<JSHTMLMediaElement>::set<setJSHTMLMediaElementPlaybackRateSetter>(*state, thisValue, encodedValue, "playbackRate");
851}
852
853static inline JSValue jsHTMLMediaElementPlayedGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
854{
855 UNUSED_PARAM(throwScope);
856 UNUSED_PARAM(state);
857 auto& impl = thisObject.wrapped();
858 JSValue result = toJS<IDLInterface<TimeRanges>>(state, *thisObject.globalObject(), throwScope, impl.played());
859 return result;
860}
861
862EncodedJSValue jsHTMLMediaElementPlayed(ExecState* state, EncodedJSValue thisValue, PropertyName)
863{
864 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementPlayedGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "played");
865}
866
867static inline JSValue jsHTMLMediaElementSeekableGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
868{
869 UNUSED_PARAM(throwScope);
870 UNUSED_PARAM(state);
871 auto& impl = thisObject.wrapped();
872 JSValue result = toJS<IDLInterface<TimeRanges>>(state, *thisObject.globalObject(), throwScope, impl.seekable());
873 return result;
874}
875
876EncodedJSValue jsHTMLMediaElementSeekable(ExecState* state, EncodedJSValue thisValue, PropertyName)
877{
878 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementSeekableGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "seekable");
879}
880
881static inline JSValue jsHTMLMediaElementEndedGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
882{
883 UNUSED_PARAM(throwScope);
884 UNUSED_PARAM(state);
885 auto& impl = thisObject.wrapped();
886 JSValue result = toJS<IDLBoolean>(state, throwScope, impl.ended());
887 return result;
888}
889
890EncodedJSValue jsHTMLMediaElementEnded(ExecState* state, EncodedJSValue thisValue, PropertyName)
891{
892 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementEndedGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "ended");
893}
894
895static inline JSValue jsHTMLMediaElementAutoplayGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
896{
897 UNUSED_PARAM(throwScope);
898 UNUSED_PARAM(state);
899 auto& impl = thisObject.wrapped();
900 JSValue result = toJS<IDLBoolean>(state, throwScope, impl.hasAttributeWithoutSynchronization(WebCore::HTMLNames::autoplayAttr));
901 return result;
902}
903
904EncodedJSValue jsHTMLMediaElementAutoplay(ExecState* state, EncodedJSValue thisValue, PropertyName)
905{
906 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementAutoplayGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "autoplay");
907}
908
909static inline bool setJSHTMLMediaElementAutoplaySetter(ExecState& state, JSHTMLMediaElement& thisObject, JSValue value, ThrowScope& throwScope)
910{
911 UNUSED_PARAM(throwScope);
912 CustomElementReactionDisallowedScope customElementReactionDisallowedScope;
913 auto& impl = thisObject.wrapped();
914 auto nativeValue = convert<IDLBoolean>(state, value);
915 RETURN_IF_EXCEPTION(throwScope, false);
916 AttributeSetter::call(state, throwScope, [&] {
917 return impl.setBooleanAttribute(WebCore::HTMLNames::autoplayAttr, WTFMove(nativeValue));
918 });
919 return true;
920}
921
922bool setJSHTMLMediaElementAutoplay(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
923{
924 return IDLAttribute<JSHTMLMediaElement>::set<setJSHTMLMediaElementAutoplaySetter>(*state, thisValue, encodedValue, "autoplay");
925}
926
927static inline JSValue jsHTMLMediaElementLoopGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
928{
929 UNUSED_PARAM(throwScope);
930 UNUSED_PARAM(state);
931 auto& impl = thisObject.wrapped();
932 JSValue result = toJS<IDLBoolean>(state, throwScope, impl.hasAttributeWithoutSynchronization(WebCore::HTMLNames::loopAttr));
933 return result;
934}
935
936EncodedJSValue jsHTMLMediaElementLoop(ExecState* state, EncodedJSValue thisValue, PropertyName)
937{
938 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementLoopGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "loop");
939}
940
941static inline bool setJSHTMLMediaElementLoopSetter(ExecState& state, JSHTMLMediaElement& thisObject, JSValue value, ThrowScope& throwScope)
942{
943 UNUSED_PARAM(throwScope);
944 CustomElementReactionDisallowedScope customElementReactionDisallowedScope;
945 auto& impl = thisObject.wrapped();
946 auto nativeValue = convert<IDLBoolean>(state, value);
947 RETURN_IF_EXCEPTION(throwScope, false);
948 AttributeSetter::call(state, throwScope, [&] {
949 return impl.setBooleanAttribute(WebCore::HTMLNames::loopAttr, WTFMove(nativeValue));
950 });
951 return true;
952}
953
954bool setJSHTMLMediaElementLoop(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
955{
956 return IDLAttribute<JSHTMLMediaElement>::set<setJSHTMLMediaElementLoopSetter>(*state, thisValue, encodedValue, "loop");
957}
958
959static inline JSValue jsHTMLMediaElementControlsGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
960{
961 UNUSED_PARAM(throwScope);
962 UNUSED_PARAM(state);
963 auto& impl = thisObject.wrapped();
964 JSValue result = toJS<IDLBoolean>(state, throwScope, impl.controls());
965 return result;
966}
967
968EncodedJSValue jsHTMLMediaElementControls(ExecState* state, EncodedJSValue thisValue, PropertyName)
969{
970 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementControlsGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "controls");
971}
972
973static inline bool setJSHTMLMediaElementControlsSetter(ExecState& state, JSHTMLMediaElement& thisObject, JSValue value, ThrowScope& throwScope)
974{
975 UNUSED_PARAM(throwScope);
976 CustomElementReactionDisallowedScope customElementReactionDisallowedScope;
977 auto& impl = thisObject.wrapped();
978 auto nativeValue = convert<IDLBoolean>(state, value);
979 RETURN_IF_EXCEPTION(throwScope, false);
980 AttributeSetter::call(state, throwScope, [&] {
981 return impl.setControls(WTFMove(nativeValue));
982 });
983 return true;
984}
985
986bool setJSHTMLMediaElementControls(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
987{
988 return IDLAttribute<JSHTMLMediaElement>::set<setJSHTMLMediaElementControlsSetter>(*state, thisValue, encodedValue, "controls");
989}
990
991static inline JSValue jsHTMLMediaElementVolumeGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
992{
993 UNUSED_PARAM(throwScope);
994 UNUSED_PARAM(state);
995 auto& impl = thisObject.wrapped();
996 JSValue result = toJS<IDLDouble>(state, throwScope, impl.volume());
997 return result;
998}
999
1000EncodedJSValue jsHTMLMediaElementVolume(ExecState* state, EncodedJSValue thisValue, PropertyName)
1001{
1002 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementVolumeGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "volume");
1003}
1004
1005static inline bool setJSHTMLMediaElementVolumeSetter(ExecState& state, JSHTMLMediaElement& thisObject, JSValue value, ThrowScope& throwScope)
1006{
1007 UNUSED_PARAM(throwScope);
1008 auto& impl = thisObject.wrapped();
1009 auto nativeValue = convert<IDLDouble>(state, value);
1010 RETURN_IF_EXCEPTION(throwScope, false);
1011 AttributeSetter::call(state, throwScope, [&] {
1012 return impl.setVolume(WTFMove(nativeValue));
1013 });
1014 return true;
1015}
1016
1017bool setJSHTMLMediaElementVolume(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1018{
1019 return IDLAttribute<JSHTMLMediaElement>::set<setJSHTMLMediaElementVolumeSetter>(*state, thisValue, encodedValue, "volume");
1020}
1021
1022static inline JSValue jsHTMLMediaElementMutedGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
1023{
1024 UNUSED_PARAM(throwScope);
1025 UNUSED_PARAM(state);
1026 auto& impl = thisObject.wrapped();
1027 JSValue result = toJS<IDLBoolean>(state, throwScope, impl.muted());
1028 return result;
1029}
1030
1031EncodedJSValue jsHTMLMediaElementMuted(ExecState* state, EncodedJSValue thisValue, PropertyName)
1032{
1033 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementMutedGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "muted");
1034}
1035
1036static inline bool setJSHTMLMediaElementMutedSetter(ExecState& state, JSHTMLMediaElement& thisObject, JSValue value, ThrowScope& throwScope)
1037{
1038 UNUSED_PARAM(throwScope);
1039 auto& impl = thisObject.wrapped();
1040 auto nativeValue = convert<IDLBoolean>(state, value);
1041 RETURN_IF_EXCEPTION(throwScope, false);
1042 AttributeSetter::call(state, throwScope, [&] {
1043 return impl.setMuted(WTFMove(nativeValue));
1044 });
1045 return true;
1046}
1047
1048bool setJSHTMLMediaElementMuted(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1049{
1050 return IDLAttribute<JSHTMLMediaElement>::set<setJSHTMLMediaElementMutedSetter>(*state, thisValue, encodedValue, "muted");
1051}
1052
1053static inline JSValue jsHTMLMediaElementDefaultMutedGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
1054{
1055 UNUSED_PARAM(throwScope);
1056 UNUSED_PARAM(state);
1057 auto& impl = thisObject.wrapped();
1058 JSValue result = toJS<IDLBoolean>(state, throwScope, impl.hasAttributeWithoutSynchronization(WebCore::HTMLNames::mutedAttr));
1059 return result;
1060}
1061
1062EncodedJSValue jsHTMLMediaElementDefaultMuted(ExecState* state, EncodedJSValue thisValue, PropertyName)
1063{
1064 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementDefaultMutedGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "defaultMuted");
1065}
1066
1067static inline bool setJSHTMLMediaElementDefaultMutedSetter(ExecState& state, JSHTMLMediaElement& thisObject, JSValue value, ThrowScope& throwScope)
1068{
1069 UNUSED_PARAM(throwScope);
1070 CustomElementReactionDisallowedScope customElementReactionDisallowedScope;
1071 auto& impl = thisObject.wrapped();
1072 auto nativeValue = convert<IDLBoolean>(state, value);
1073 RETURN_IF_EXCEPTION(throwScope, false);
1074 AttributeSetter::call(state, throwScope, [&] {
1075 return impl.setBooleanAttribute(WebCore::HTMLNames::mutedAttr, WTFMove(nativeValue));
1076 });
1077 return true;
1078}
1079
1080bool setJSHTMLMediaElementDefaultMuted(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1081{
1082 return IDLAttribute<JSHTMLMediaElement>::set<setJSHTMLMediaElementDefaultMutedSetter>(*state, thisValue, encodedValue, "defaultMuted");
1083}
1084
1085static inline JSValue jsHTMLMediaElementWebkitPreservesPitchGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
1086{
1087 UNUSED_PARAM(throwScope);
1088 UNUSED_PARAM(state);
1089 auto& impl = thisObject.wrapped();
1090 JSValue result = toJS<IDLBoolean>(state, throwScope, impl.webkitPreservesPitch());
1091 return result;
1092}
1093
1094EncodedJSValue jsHTMLMediaElementWebkitPreservesPitch(ExecState* state, EncodedJSValue thisValue, PropertyName)
1095{
1096 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementWebkitPreservesPitchGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "webkitPreservesPitch");
1097}
1098
1099static inline bool setJSHTMLMediaElementWebkitPreservesPitchSetter(ExecState& state, JSHTMLMediaElement& thisObject, JSValue value, ThrowScope& throwScope)
1100{
1101 UNUSED_PARAM(throwScope);
1102 CustomElementReactionStack customElementReactionStack(state);
1103 auto& impl = thisObject.wrapped();
1104 auto nativeValue = convert<IDLBoolean>(state, value);
1105 RETURN_IF_EXCEPTION(throwScope, false);
1106 AttributeSetter::call(state, throwScope, [&] {
1107 return impl.setWebkitPreservesPitch(WTFMove(nativeValue));
1108 });
1109 return true;
1110}
1111
1112bool setJSHTMLMediaElementWebkitPreservesPitch(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1113{
1114 return IDLAttribute<JSHTMLMediaElement>::set<setJSHTMLMediaElementWebkitPreservesPitchSetter>(*state, thisValue, encodedValue, "webkitPreservesPitch");
1115}
1116
1117static inline JSValue jsHTMLMediaElementWebkitHasClosedCaptionsGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
1118{
1119 UNUSED_PARAM(throwScope);
1120 UNUSED_PARAM(state);
1121 auto& impl = thisObject.wrapped();
1122 JSValue result = toJS<IDLBoolean>(state, throwScope, impl.webkitHasClosedCaptions());
1123 return result;
1124}
1125
1126EncodedJSValue jsHTMLMediaElementWebkitHasClosedCaptions(ExecState* state, EncodedJSValue thisValue, PropertyName)
1127{
1128 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementWebkitHasClosedCaptionsGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "webkitHasClosedCaptions");
1129}
1130
1131static inline JSValue jsHTMLMediaElementWebkitClosedCaptionsVisibleGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
1132{
1133 UNUSED_PARAM(throwScope);
1134 UNUSED_PARAM(state);
1135 auto& impl = thisObject.wrapped();
1136 JSValue result = toJS<IDLBoolean>(state, throwScope, impl.webkitClosedCaptionsVisible());
1137 return result;
1138}
1139
1140EncodedJSValue jsHTMLMediaElementWebkitClosedCaptionsVisible(ExecState* state, EncodedJSValue thisValue, PropertyName)
1141{
1142 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementWebkitClosedCaptionsVisibleGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "webkitClosedCaptionsVisible");
1143}
1144
1145static inline bool setJSHTMLMediaElementWebkitClosedCaptionsVisibleSetter(ExecState& state, JSHTMLMediaElement& thisObject, JSValue value, ThrowScope& throwScope)
1146{
1147 UNUSED_PARAM(throwScope);
1148 auto& impl = thisObject.wrapped();
1149 auto nativeValue = convert<IDLBoolean>(state, value);
1150 RETURN_IF_EXCEPTION(throwScope, false);
1151 AttributeSetter::call(state, throwScope, [&] {
1152 return impl.setWebkitClosedCaptionsVisible(WTFMove(nativeValue));
1153 });
1154 return true;
1155}
1156
1157bool setJSHTMLMediaElementWebkitClosedCaptionsVisible(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1158{
1159 return IDLAttribute<JSHTMLMediaElement>::set<setJSHTMLMediaElementWebkitClosedCaptionsVisibleSetter>(*state, thisValue, encodedValue, "webkitClosedCaptionsVisible");
1160}
1161
1162#if ENABLE(MEDIA_STATISTICS)
1163static inline JSValue jsHTMLMediaElementWebkitAudioDecodedByteCountGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
1164{
1165 UNUSED_PARAM(throwScope);
1166 UNUSED_PARAM(state);
1167 auto& impl = thisObject.wrapped();
1168 JSValue result = toJS<IDLUnsignedLong>(state, throwScope, impl.webkitAudioDecodedByteCount());
1169 return result;
1170}
1171
1172EncodedJSValue jsHTMLMediaElementWebkitAudioDecodedByteCount(ExecState* state, EncodedJSValue thisValue, PropertyName)
1173{
1174 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementWebkitAudioDecodedByteCountGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "webkitAudioDecodedByteCount");
1175}
1176
1177#endif
1178
1179#if ENABLE(MEDIA_STATISTICS)
1180static inline JSValue jsHTMLMediaElementWebkitVideoDecodedByteCountGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
1181{
1182 UNUSED_PARAM(throwScope);
1183 UNUSED_PARAM(state);
1184 auto& impl = thisObject.wrapped();
1185 JSValue result = toJS<IDLUnsignedLong>(state, throwScope, impl.webkitVideoDecodedByteCount());
1186 return result;
1187}
1188
1189EncodedJSValue jsHTMLMediaElementWebkitVideoDecodedByteCount(ExecState* state, EncodedJSValue thisValue, PropertyName)
1190{
1191 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementWebkitVideoDecodedByteCountGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "webkitVideoDecodedByteCount");
1192}
1193
1194#endif
1195
1196#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
1197static inline JSValue jsHTMLMediaElementWebkitKeysGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
1198{
1199 UNUSED_PARAM(throwScope);
1200 UNUSED_PARAM(state);
1201 auto& impl = thisObject.wrapped();
1202 JSValue result = toJS<IDLInterface<WebKitMediaKeys>>(state, *thisObject.globalObject(), throwScope, impl.webkitKeys());
1203 return result;
1204}
1205
1206EncodedJSValue jsHTMLMediaElementWebkitKeys(ExecState* state, EncodedJSValue thisValue, PropertyName)
1207{
1208 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementWebkitKeysGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "webkitKeys");
1209}
1210
1211#endif
1212
1213#if ENABLE(ENCRYPTED_MEDIA)
1214static inline JSValue jsHTMLMediaElementMediaKeysGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
1215{
1216 UNUSED_PARAM(throwScope);
1217 UNUSED_PARAM(state);
1218 auto& impl = thisObject.wrapped();
1219 JSValue result = toJS<IDLInterface<MediaKeys>>(state, *thisObject.globalObject(), throwScope, impl.mediaKeys());
1220 return result;
1221}
1222
1223EncodedJSValue jsHTMLMediaElementMediaKeys(ExecState* state, EncodedJSValue thisValue, PropertyName)
1224{
1225 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementMediaKeysGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "mediaKeys");
1226}
1227
1228#endif
1229
1230#if ENABLE(ENCRYPTED_MEDIA)
1231static inline JSValue jsHTMLMediaElementOnencryptedGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
1232{
1233 UNUSED_PARAM(throwScope);
1234 UNUSED_PARAM(state);
1235 return eventHandlerAttribute(thisObject.wrapped(), eventNames().encryptedEvent, worldForDOMObject(thisObject));
1236}
1237
1238EncodedJSValue jsHTMLMediaElementOnencrypted(ExecState* state, EncodedJSValue thisValue, PropertyName)
1239{
1240 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementOnencryptedGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "onencrypted");
1241}
1242
1243#endif
1244
1245#if ENABLE(ENCRYPTED_MEDIA)
1246static inline bool setJSHTMLMediaElementOnencryptedSetter(ExecState& state, JSHTMLMediaElement& thisObject, JSValue value, ThrowScope& throwScope)
1247{
1248 UNUSED_PARAM(throwScope);
1249 setEventHandlerAttribute(state, thisObject, thisObject.wrapped(), eventNames().encryptedEvent, value);
1250 return true;
1251}
1252
1253bool setJSHTMLMediaElementOnencrypted(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1254{
1255 return IDLAttribute<JSHTMLMediaElement>::set<setJSHTMLMediaElementOnencryptedSetter>(*state, thisValue, encodedValue, "onencrypted");
1256}
1257
1258#endif
1259
1260#if ENABLE(ENCRYPTED_MEDIA)
1261static inline JSValue jsHTMLMediaElementOnwaitingforkeyGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
1262{
1263 UNUSED_PARAM(throwScope);
1264 UNUSED_PARAM(state);
1265 return eventHandlerAttribute(thisObject.wrapped(), eventNames().waitingforkeyEvent, worldForDOMObject(thisObject));
1266}
1267
1268EncodedJSValue jsHTMLMediaElementOnwaitingforkey(ExecState* state, EncodedJSValue thisValue, PropertyName)
1269{
1270 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementOnwaitingforkeyGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "onwaitingforkey");
1271}
1272
1273#endif
1274
1275#if ENABLE(ENCRYPTED_MEDIA)
1276static inline bool setJSHTMLMediaElementOnwaitingforkeySetter(ExecState& state, JSHTMLMediaElement& thisObject, JSValue value, ThrowScope& throwScope)
1277{
1278 UNUSED_PARAM(throwScope);
1279 setEventHandlerAttribute(state, thisObject, thisObject.wrapped(), eventNames().waitingforkeyEvent, value);
1280 return true;
1281}
1282
1283bool setJSHTMLMediaElementOnwaitingforkey(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1284{
1285 return IDLAttribute<JSHTMLMediaElement>::set<setJSHTMLMediaElementOnwaitingforkeySetter>(*state, thisValue, encodedValue, "onwaitingforkey");
1286}
1287
1288#endif
1289
1290#if ENABLE(VIDEO_TRACK)
1291static inline JSValue jsHTMLMediaElementAudioTracksGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
1292{
1293 UNUSED_PARAM(throwScope);
1294 UNUSED_PARAM(state);
1295 auto& impl = thisObject.wrapped();
1296 JSValue result = toJS<IDLInterface<AudioTrackList>>(state, *thisObject.globalObject(), throwScope, impl.ensureAudioTracks());
1297 return result;
1298}
1299
1300EncodedJSValue jsHTMLMediaElementAudioTracks(ExecState* state, EncodedJSValue thisValue, PropertyName)
1301{
1302 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementAudioTracksGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "audioTracks");
1303}
1304
1305#endif
1306
1307#if ENABLE(VIDEO_TRACK)
1308static inline JSValue jsHTMLMediaElementTextTracksGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
1309{
1310 UNUSED_PARAM(throwScope);
1311 UNUSED_PARAM(state);
1312 auto& impl = thisObject.wrapped();
1313 JSValue result = toJS<IDLInterface<TextTrackList>>(state, *thisObject.globalObject(), throwScope, impl.ensureTextTracks());
1314 return result;
1315}
1316
1317EncodedJSValue jsHTMLMediaElementTextTracks(ExecState* state, EncodedJSValue thisValue, PropertyName)
1318{
1319 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementTextTracksGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "textTracks");
1320}
1321
1322#endif
1323
1324#if ENABLE(VIDEO_TRACK)
1325static inline JSValue jsHTMLMediaElementVideoTracksGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
1326{
1327 UNUSED_PARAM(throwScope);
1328 UNUSED_PARAM(state);
1329 auto& impl = thisObject.wrapped();
1330 JSValue result = toJS<IDLInterface<VideoTrackList>>(state, *thisObject.globalObject(), throwScope, impl.ensureVideoTracks());
1331 return result;
1332}
1333
1334EncodedJSValue jsHTMLMediaElementVideoTracks(ExecState* state, EncodedJSValue thisValue, PropertyName)
1335{
1336 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementVideoTracksGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "videoTracks");
1337}
1338
1339#endif
1340
1341static inline JSValue jsHTMLMediaElementMediaGroupGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
1342{
1343 UNUSED_PARAM(throwScope);
1344 UNUSED_PARAM(state);
1345 auto& impl = thisObject.wrapped();
1346 JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::mediagroupAttr));
1347 return result;
1348}
1349
1350EncodedJSValue jsHTMLMediaElementMediaGroup(ExecState* state, EncodedJSValue thisValue, PropertyName)
1351{
1352 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementMediaGroupGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "mediaGroup");
1353}
1354
1355static inline bool setJSHTMLMediaElementMediaGroupSetter(ExecState& state, JSHTMLMediaElement& thisObject, JSValue value, ThrowScope& throwScope)
1356{
1357 UNUSED_PARAM(throwScope);
1358 auto& impl = thisObject.wrapped();
1359 auto nativeValue = convert<IDLDOMString>(state, value);
1360 RETURN_IF_EXCEPTION(throwScope, false);
1361 AttributeSetter::call(state, throwScope, [&] {
1362 return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::mediagroupAttr, WTFMove(nativeValue));
1363 });
1364 return true;
1365}
1366
1367bool setJSHTMLMediaElementMediaGroup(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1368{
1369 return IDLAttribute<JSHTMLMediaElement>::set<setJSHTMLMediaElementMediaGroupSetter>(*state, thisValue, encodedValue, "mediaGroup");
1370}
1371
1372static inline JSValue jsHTMLMediaElementControllerGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
1373{
1374 UNUSED_PARAM(throwScope);
1375 UNUSED_PARAM(state);
1376 auto& impl = thisObject.wrapped();
1377 JSValue result = toJS<IDLNullable<IDLInterface<MediaController>>>(state, *thisObject.globalObject(), throwScope, impl.controllerForBindings());
1378 return result;
1379}
1380
1381EncodedJSValue jsHTMLMediaElementController(ExecState* state, EncodedJSValue thisValue, PropertyName)
1382{
1383 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementControllerGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "controller");
1384}
1385
1386static inline bool setJSHTMLMediaElementControllerSetter(ExecState& state, JSHTMLMediaElement& thisObject, JSValue value, ThrowScope& throwScope)
1387{
1388 UNUSED_PARAM(throwScope);
1389 auto& impl = thisObject.wrapped();
1390 auto nativeValue = convert<IDLNullable<IDLInterface<MediaController>>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "HTMLMediaElement", "controller", "MediaController"); });
1391 RETURN_IF_EXCEPTION(throwScope, false);
1392 AttributeSetter::call(state, throwScope, [&] {
1393 return impl.setControllerForBindings(WTFMove(nativeValue));
1394 });
1395 return true;
1396}
1397
1398bool setJSHTMLMediaElementController(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1399{
1400 return IDLAttribute<JSHTMLMediaElement>::set<setJSHTMLMediaElementControllerSetter>(*state, thisValue, encodedValue, "controller");
1401}
1402
1403#if ENABLE(WIRELESS_PLAYBACK_TARGET)
1404static inline JSValue jsHTMLMediaElementWebkitCurrentPlaybackTargetIsWirelessGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
1405{
1406 UNUSED_PARAM(throwScope);
1407 UNUSED_PARAM(state);
1408 auto& impl = thisObject.wrapped();
1409 JSValue result = toJS<IDLBoolean>(state, throwScope, impl.webkitCurrentPlaybackTargetIsWireless());
1410 return result;
1411}
1412
1413EncodedJSValue jsHTMLMediaElementWebkitCurrentPlaybackTargetIsWireless(ExecState* state, EncodedJSValue thisValue, PropertyName)
1414{
1415 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementWebkitCurrentPlaybackTargetIsWirelessGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "webkitCurrentPlaybackTargetIsWireless");
1416}
1417
1418#endif
1419
1420#if ENABLE(MEDIA_SESSION) && ENABLE(VIDEO)
1421static inline JSValue jsHTMLMediaElementKindGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
1422{
1423 UNUSED_PARAM(throwScope);
1424 UNUSED_PARAM(state);
1425 auto& impl = thisObject.wrapped();
1426 JSValue result = toJS<IDLDOMString>(state, throwScope, WebCore::HTMLMediaElementMediaSession::kind(impl));
1427 return result;
1428}
1429
1430EncodedJSValue jsHTMLMediaElementKind(ExecState* state, EncodedJSValue thisValue, PropertyName)
1431{
1432 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementKindGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "kind");
1433}
1434
1435#endif
1436
1437#if ENABLE(MEDIA_SESSION) && ENABLE(VIDEO)
1438static inline bool setJSHTMLMediaElementKindSetter(ExecState& state, JSHTMLMediaElement& thisObject, JSValue value, ThrowScope& throwScope)
1439{
1440 UNUSED_PARAM(throwScope);
1441 auto& impl = thisObject.wrapped();
1442 auto nativeValue = convert<IDLDOMString>(state, value);
1443 RETURN_IF_EXCEPTION(throwScope, false);
1444 AttributeSetter::call(state, throwScope, [&] {
1445 return WebCore::HTMLMediaElementMediaSession::setKind(impl, WTFMove(nativeValue));
1446 });
1447 return true;
1448}
1449
1450bool setJSHTMLMediaElementKind(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1451{
1452 return IDLAttribute<JSHTMLMediaElement>::set<setJSHTMLMediaElementKindSetter>(*state, thisValue, encodedValue, "kind");
1453}
1454
1455#endif
1456
1457#if ENABLE(MEDIA_SESSION) && ENABLE(VIDEO)
1458static inline JSValue jsHTMLMediaElementSessionGetter(ExecState& state, JSHTMLMediaElement& thisObject, ThrowScope& throwScope)
1459{
1460 UNUSED_PARAM(throwScope);
1461 UNUSED_PARAM(state);
1462 auto& impl = thisObject.wrapped();
1463 JSValue result = toJS<IDLNullable<IDLInterface<MediaSession>>>(state, *thisObject.globalObject(), throwScope, WebCore::HTMLMediaElementMediaSession::session(impl));
1464 return result;
1465}
1466
1467EncodedJSValue jsHTMLMediaElementSession(ExecState* state, EncodedJSValue thisValue, PropertyName)
1468{
1469 return IDLAttribute<JSHTMLMediaElement>::get<jsHTMLMediaElementSessionGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "session");
1470}
1471
1472#endif
1473
1474#if ENABLE(MEDIA_SESSION) && ENABLE(VIDEO)
1475static inline bool setJSHTMLMediaElementSessionSetter(ExecState& state, JSHTMLMediaElement& thisObject, JSValue value, ThrowScope& throwScope)
1476{
1477 UNUSED_PARAM(throwScope);
1478 auto& impl = thisObject.wrapped();
1479 auto nativeValue = convert<IDLNullable<IDLInterface<MediaSession>>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "HTMLMediaElement", "session", "MediaSession"); });
1480 RETURN_IF_EXCEPTION(throwScope, false);
1481 AttributeSetter::call(state, throwScope, [&] {
1482 return WebCore::HTMLMediaElementMediaSession::setSession(impl, WTFMove(nativeValue));
1483 });
1484 return true;
1485}
1486
1487bool setJSHTMLMediaElementSession(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1488{
1489 return IDLAttribute<JSHTMLMediaElement>::set<setJSHTMLMediaElementSessionSetter>(*state, thisValue, encodedValue, "session");
1490}
1491
1492#endif
1493
1494static inline JSC::EncodedJSValue jsHTMLMediaElementPrototypeFunctionLoadBody(JSC::ExecState* state, typename IDLOperation<JSHTMLMediaElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
1495{
1496 UNUSED_PARAM(state);
1497 UNUSED_PARAM(throwScope);
1498 auto& impl = castedThis->wrapped();
1499 impl.load();
1500 return JSValue::encode(jsUndefined());
1501}
1502
1503EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionLoad(ExecState* state)
1504{
1505 return IDLOperation<JSHTMLMediaElement>::call<jsHTMLMediaElementPrototypeFunctionLoadBody>(*state, "load");
1506}
1507
1508static inline JSC::EncodedJSValue jsHTMLMediaElementPrototypeFunctionCanPlayTypeBody(JSC::ExecState* state, typename IDLOperation<JSHTMLMediaElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
1509{
1510 UNUSED_PARAM(state);
1511 UNUSED_PARAM(throwScope);
1512 auto& impl = castedThis->wrapped();
1513 if (UNLIKELY(state->argumentCount() < 1))
1514 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
1515 auto type = convert<IDLDOMString>(*state, state->uncheckedArgument(0));
1516 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
1517 return JSValue::encode(toJS<IDLDOMString>(*state, impl.canPlayType(WTFMove(type))));
1518}
1519
1520EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionCanPlayType(ExecState* state)
1521{
1522 return IDLOperation<JSHTMLMediaElement>::call<jsHTMLMediaElementPrototypeFunctionCanPlayTypeBody>(*state, "canPlayType");
1523}
1524
1525static inline JSC::EncodedJSValue jsHTMLMediaElementPrototypeFunctionGetStartDateBody(JSC::ExecState* state, typename IDLOperation<JSHTMLMediaElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
1526{
1527 UNUSED_PARAM(state);
1528 UNUSED_PARAM(throwScope);
1529 auto& impl = castedThis->wrapped();
1530 return JSValue::encode(toJS<IDLDate>(*state, impl.getStartDate()));
1531}
1532
1533EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionGetStartDate(ExecState* state)
1534{
1535 return IDLOperation<JSHTMLMediaElement>::call<jsHTMLMediaElementPrototypeFunctionGetStartDateBody>(*state, "getStartDate");
1536}
1537
1538static inline JSC::EncodedJSValue jsHTMLMediaElementPrototypeFunctionPlayBody(JSC::ExecState* state, typename IDLOperationReturningPromise<JSHTMLMediaElement>::ClassParameter castedThis, Ref<DeferredPromise>&& promise, JSC::ThrowScope& throwScope)
1539{
1540 UNUSED_PARAM(state);
1541 UNUSED_PARAM(throwScope);
1542 auto& impl = castedThis->wrapped();
1543 impl.play(WTFMove(promise));
1544 return JSValue::encode(jsUndefined());
1545}
1546
1547EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionPlay(ExecState* state)
1548{
1549 return IDLOperationReturningPromise<JSHTMLMediaElement>::call<jsHTMLMediaElementPrototypeFunctionPlayBody, PromiseExecutionScope::WindowOnly>(*state, "play");
1550}
1551
1552static inline JSC::EncodedJSValue jsHTMLMediaElementPrototypeFunctionPauseBody(JSC::ExecState* state, typename IDLOperation<JSHTMLMediaElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
1553{
1554 UNUSED_PARAM(state);
1555 UNUSED_PARAM(throwScope);
1556 auto& impl = castedThis->wrapped();
1557 impl.pause();
1558 return JSValue::encode(jsUndefined());
1559}
1560
1561EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionPause(ExecState* state)
1562{
1563 return IDLOperation<JSHTMLMediaElement>::call<jsHTMLMediaElementPrototypeFunctionPauseBody>(*state, "pause");
1564}
1565
1566static inline JSC::EncodedJSValue jsHTMLMediaElementPrototypeFunctionFastSeekBody(JSC::ExecState* state, typename IDLOperation<JSHTMLMediaElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
1567{
1568 UNUSED_PARAM(state);
1569 UNUSED_PARAM(throwScope);
1570 auto& impl = castedThis->wrapped();
1571 if (UNLIKELY(state->argumentCount() < 1))
1572 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
1573 auto time = convert<IDLUnrestrictedDouble>(*state, state->uncheckedArgument(0));
1574 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
1575 impl.fastSeek(WTFMove(time));
1576 return JSValue::encode(jsUndefined());
1577}
1578
1579EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionFastSeek(ExecState* state)
1580{
1581 return IDLOperation<JSHTMLMediaElement>::call<jsHTMLMediaElementPrototypeFunctionFastSeekBody>(*state, "fastSeek");
1582}
1583
1584#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
1585static inline JSC::EncodedJSValue jsHTMLMediaElementPrototypeFunctionWebkitSetMediaKeysBody(JSC::ExecState* state, typename IDLOperation<JSHTMLMediaElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
1586{
1587 UNUSED_PARAM(state);
1588 UNUSED_PARAM(throwScope);
1589 auto& impl = castedThis->wrapped();
1590 if (UNLIKELY(state->argumentCount() < 1))
1591 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
1592 auto mediaKeys = convert<IDLNullable<IDLInterface<WebKitMediaKeys>>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "mediaKeys", "HTMLMediaElement", "webkitSetMediaKeys", "WebKitMediaKeys"); });
1593 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
1594 impl.webkitSetMediaKeys(WTFMove(mediaKeys));
1595 return JSValue::encode(jsUndefined());
1596}
1597
1598EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionWebkitSetMediaKeys(ExecState* state)
1599{
1600 return IDLOperation<JSHTMLMediaElement>::call<jsHTMLMediaElementPrototypeFunctionWebkitSetMediaKeysBody>(*state, "webkitSetMediaKeys");
1601}
1602
1603#endif
1604
1605#if ENABLE(ENCRYPTED_MEDIA)
1606static inline JSC::EncodedJSValue jsHTMLMediaElementPrototypeFunctionSetMediaKeysBody(JSC::ExecState* state, typename IDLOperationReturningPromise<JSHTMLMediaElement>::ClassParameter castedThis, Ref<DeferredPromise>&& promise, JSC::ThrowScope& throwScope)
1607{
1608 UNUSED_PARAM(state);
1609 UNUSED_PARAM(throwScope);
1610 auto& impl = castedThis->wrapped();
1611 if (UNLIKELY(state->argumentCount() < 1))
1612 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
1613 auto mediaKeys = convert<IDLNullable<IDLInterface<MediaKeys>>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "mediaKeys", "HTMLMediaElement", "setMediaKeys", "MediaKeys"); });
1614 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
1615 impl.setMediaKeys(WTFMove(mediaKeys), WTFMove(promise));
1616 return JSValue::encode(jsUndefined());
1617}
1618
1619EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionSetMediaKeys(ExecState* state)
1620{
1621 return IDLOperationReturningPromise<JSHTMLMediaElement>::call<jsHTMLMediaElementPrototypeFunctionSetMediaKeysBody, PromiseExecutionScope::WindowOnly>(*state, "setMediaKeys");
1622}
1623
1624#endif
1625
1626#if ENABLE(VIDEO_TRACK)
1627static inline JSC::EncodedJSValue jsHTMLMediaElementPrototypeFunctionAddTextTrackBody(JSC::ExecState* state, typename IDLOperation<JSHTMLMediaElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
1628{
1629 UNUSED_PARAM(state);
1630 UNUSED_PARAM(throwScope);
1631 auto& impl = castedThis->wrapped();
1632 if (UNLIKELY(state->argumentCount() < 1))
1633 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
1634 auto kind = convert<IDLDOMString>(*state, state->uncheckedArgument(0));
1635 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
1636 auto label = state->argument(1).isUndefined() ? emptyString() : convert<IDLDOMString>(*state, state->uncheckedArgument(1));
1637 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
1638 auto language = state->argument(2).isUndefined() ? emptyString() : convert<IDLDOMString>(*state, state->uncheckedArgument(2));
1639 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
1640 return JSValue::encode(toJS<IDLInterface<TextTrack>>(*state, *castedThis->globalObject(), throwScope, impl.addTextTrack(WTFMove(kind), WTFMove(label), WTFMove(language))));
1641}
1642
1643EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionAddTextTrack(ExecState* state)
1644{
1645 return IDLOperation<JSHTMLMediaElement>::call<jsHTMLMediaElementPrototypeFunctionAddTextTrackBody>(*state, "addTextTrack");
1646}
1647
1648#endif
1649
1650static inline JSC::EncodedJSValue jsHTMLMediaElementPrototypeFunctionGetVideoPlaybackQualityBody(JSC::ExecState* state, typename IDLOperation<JSHTMLMediaElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
1651{
1652 UNUSED_PARAM(state);
1653 UNUSED_PARAM(throwScope);
1654 auto& impl = castedThis->wrapped();
1655 return JSValue::encode(toJS<IDLInterface<VideoPlaybackQuality>>(*state, *castedThis->globalObject(), impl.getVideoPlaybackQuality()));
1656}
1657
1658EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionGetVideoPlaybackQuality(ExecState* state)
1659{
1660 return IDLOperation<JSHTMLMediaElement>::call<jsHTMLMediaElementPrototypeFunctionGetVideoPlaybackQualityBody>(*state, "getVideoPlaybackQuality");
1661}
1662
1663#if ENABLE(WIRELESS_PLAYBACK_TARGET)
1664static inline JSC::EncodedJSValue jsHTMLMediaElementPrototypeFunctionWebkitShowPlaybackTargetPickerBody(JSC::ExecState* state, typename IDLOperation<JSHTMLMediaElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
1665{
1666 UNUSED_PARAM(state);
1667 UNUSED_PARAM(throwScope);
1668 auto& impl = castedThis->wrapped();
1669 impl.webkitShowPlaybackTargetPicker();
1670 return JSValue::encode(jsUndefined());
1671}
1672
1673EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionWebkitShowPlaybackTargetPicker(ExecState* state)
1674{
1675 return IDLOperation<JSHTMLMediaElement>::call<jsHTMLMediaElementPrototypeFunctionWebkitShowPlaybackTargetPickerBody>(*state, "webkitShowPlaybackTargetPicker");
1676}
1677
1678#endif
1679
1680void JSHTMLMediaElement::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder)
1681{
1682 auto* thisObject = jsCast<JSHTMLMediaElement*>(cell);
1683 builder.setWrappedObjectForCell(cell, &thisObject->wrapped());
1684 if (thisObject->scriptExecutionContext())
1685 builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string());
1686 Base::heapSnapshot(cell, builder);
1687}
1688
1689bool JSHTMLMediaElementOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason)
1690{
1691 auto* jsHTMLMediaElement = jsCast<JSHTMLMediaElement*>(handle.slot()->asCell());
1692 if (jsHTMLMediaElement->wrapped().hasPendingActivity()) {
1693 if (UNLIKELY(reason))
1694 *reason = "ActiveDOMObject with pending activity";
1695 return true;
1696 }
1697 if (jsHTMLMediaElement->wrapped().isFiringEventListeners()) {
1698 if (UNLIKELY(reason))
1699 *reason = "EventTarget firing event listeners";
1700 return true;
1701 }
1702 if (JSNodeOwner::isReachableFromOpaqueRoots(handle, 0, visitor, reason))
1703 return true;
1704 UNUSED_PARAM(visitor);
1705 UNUSED_PARAM(reason);
1706 return false;
1707}
1708
1709void JSHTMLMediaElementOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
1710{
1711 auto* jsHTMLMediaElement = static_cast<JSHTMLMediaElement*>(handle.slot()->asCell());
1712 auto& world = *static_cast<DOMWrapperWorld*>(context);
1713 uncacheWrapper(world, &jsHTMLMediaElement->wrapped(), jsHTMLMediaElement);
1714}
1715
1716HTMLMediaElement* JSHTMLMediaElement::toWrapped(JSC::VM& vm, JSC::JSValue value)
1717{
1718 if (auto* wrapper = jsDynamicCast<JSHTMLMediaElement*>(vm, value))
1719 return &wrapper->wrapped();
1720 return nullptr;
1721}
1722
1723}
1724
1725#endif // ENABLE(VIDEO)
1726