mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibWeb/HTML: Add readiness state to TextTrack
This commit is contained in:
parent
4b16f1df05
commit
ff08c2f735
Notes:
github-actions[bot]
2024-07-26 07:31:11 +00:00
Author: https://github.com/jamierocks Commit: https://github.com/LadybirdBrowser/ladybird/commit/ff08c2f735e Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/836
1 changed files with 13 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue