/* * Copyright (c) 2023, Tim Flynn * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include namespace Web::HTML { struct TrackEventInit : public DOM::EventInit { JS::GCPtr track; }; class TrackEvent : public DOM::Event { WEB_PLATFORM_OBJECT(TrackEvent, DOM::Event); public: static WebIDL::ExceptionOr> create(JS::Realm&, FlyString const& event_name, TrackEventInit const& event_init = {}); static WebIDL::ExceptionOr> construct_impl(JS::Realm&, FlyString const& event_name, TrackEventInit const& event_init); // https://html.spec.whatwg.org/multipage/media.html#dom-trackevent-track JS::GCPtr track() const { return m_track; } private: TrackEvent(JS::Realm&, FlyString const& event_name, TrackEventInit const& event_init); virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; JS::GCPtr m_track; }; }