LibWeb/HTML: Implement TextTrack.mode

This commit is contained in:
Jamie Mansfield 2024-07-25 20:21:06 +01:00 committed by Andreas Kling
parent 97436e7d65
commit 4b16f1df05
Notes: github-actions[bot] 2024-07-26 07:31:18 +00:00
3 changed files with 17 additions and 1 deletions

View file

@ -75,6 +75,17 @@ void TextTrack::set_id(String id)
m_id = id;
}
// https://html.spec.whatwg.org/multipage/media.html#dom-texttrack-mode
Bindings::TextTrackMode TextTrack::mode()
{
return m_mode;
}
void TextTrack::set_mode(Bindings::TextTrackMode mode)
{
m_mode = mode;
}
// https://html.spec.whatwg.org/multipage/media.html#handler-texttrack-oncuechange
void TextTrack::set_oncuechange(WebIDL::CallbackType* event_handler)
{

View file

@ -36,6 +36,9 @@ public:
String id();
void set_id(String);
Bindings::TextTrackMode mode();
void set_mode(Bindings::TextTrackMode);
void set_oncuechange(WebIDL::CallbackType*);
WebIDL::CallbackType* oncuechange();
@ -49,6 +52,8 @@ private:
String m_language {};
String m_id {};
Bindings::TextTrackMode m_mode { Bindings::TextTrackMode::Disabled };
};
Bindings::TextTrackKind text_track_kind_from_string(String);

View file

@ -16,7 +16,7 @@ interface TextTrack : EventTarget {
readonly attribute DOMString id;
[FIXME] readonly attribute DOMString inBandMetadataTrackDispatchType;
[FIXME] attribute TextTrackMode mode;
attribute TextTrackMode mode;
[FIXME] readonly attribute TextTrackCueList? cues;
[FIXME] readonly attribute TextTrackCueList? activeCues;