LibWeb/HTML: Add readiness state to TextTrack

This commit is contained in:
Jamie Mansfield 2024-07-25 20:21:57 +01:00 committed by Andreas Kling
parent 4b16f1df05
commit ff08c2f735
Notes: github-actions[bot] 2024-07-26 07:31:11 +00:00

View file

@ -21,6 +21,14 @@ class TextTrack final : public DOM::EventTarget {
JS_DECLARE_ALLOCATOR(TextTrack);
public:
// https://html.spec.whatwg.org/multipage/media.html#text-track-readiness-state
enum class ReadinessState {
NotLoaded,
Loading,
Loaded,
FailedToLoad,
};
static JS::NonnullGCPtr<TextTrack> create(JS::Realm&);
virtual ~TextTrack() override;
@ -42,6 +50,9 @@ public:
void set_oncuechange(WebIDL::CallbackType*);
WebIDL::CallbackType* oncuechange();
ReadinessState readiness_state() { return m_readiness_state; }
void set_readiness_state(ReadinessState readiness_state) { m_readiness_state = readiness_state; }
private:
TextTrack(JS::Realm&);
@ -54,6 +65,8 @@ private:
String m_id {};
Bindings::TextTrackMode m_mode { Bindings::TextTrackMode::Disabled };
ReadinessState m_readiness_state { ReadinessState::NotLoaded };
};
Bindings::TextTrackKind text_track_kind_from_string(String);