2024-09-20 18:06:51 -04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2024, Jamie Mansfield <jmansfield@cadixdev.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2024-11-14 10:01:23 -05:00
|
|
|
#include <LibGC/MarkedVector.h>
|
2024-09-20 18:06:51 -04:00
|
|
|
#include <LibWeb/DOM/EventTarget.h>
|
|
|
|
#include <LibWeb/HTML/TextTrackCue.h>
|
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/media.html#texttrackcuelist
|
|
|
|
class TextTrackCueList final : public DOM::EventTarget {
|
|
|
|
WEB_PLATFORM_OBJECT(TextTrackCueList, DOM::EventTarget);
|
2024-11-14 10:01:23 -05:00
|
|
|
GC_DECLARE_ALLOCATOR(TextTrackCueList);
|
2024-09-20 18:06:51 -04:00
|
|
|
|
|
|
|
public:
|
|
|
|
virtual ~TextTrackCueList() override;
|
|
|
|
|
|
|
|
size_t length() const;
|
|
|
|
|
2024-11-14 10:01:23 -05:00
|
|
|
GC::Ptr<TextTrackCue> get_cue_by_id(StringView id) const;
|
2024-09-20 18:06:51 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
TextTrackCueList(JS::Realm&);
|
|
|
|
|
|
|
|
virtual void initialize(JS::Realm&) override;
|
|
|
|
virtual void visit_edges(Visitor&) override;
|
|
|
|
|
|
|
|
virtual JS::ThrowCompletionOr<Optional<JS::PropertyDescriptor>> internal_get_own_property(JS::PropertyKey const& property_name) const override;
|
|
|
|
|
2024-11-14 10:01:23 -05:00
|
|
|
Vector<GC::Ref<TextTrackCue>> m_cues;
|
2024-09-20 18:06:51 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|