mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-03 14:50:18 +00:00
LibWeb: Implement HTMLTrackElement.readyState
This commit is contained in:
parent
4f4fdce62a
commit
1d12cb69d4
Notes:
github-actions[bot]
2024-08-06 06:58:30 +00:00
Author: https://github.com/jamierocks
Commit: 1d12cb69d4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/977
Reviewed-by: https://github.com/tcl3 ✅
5 changed files with 38 additions and 1 deletions
|
@ -56,4 +56,30 @@ void HTMLTrackElement::attribute_changed(FlyString const& name, Optional<String>
|
|||
}
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/media.html#dom-track-readystate
|
||||
WebIDL::UnsignedShort HTMLTrackElement::ready_state()
|
||||
{
|
||||
// The readyState attribute must return the numeric value corresponding to the text track readiness state of the track element's text track, as defined by the following list:
|
||||
switch (m_track->readiness_state()) {
|
||||
case TextTrack::ReadinessState::NotLoaded:
|
||||
// NONE (numeric value 0)
|
||||
// The text track not loaded state.
|
||||
return 0;
|
||||
case TextTrack::ReadinessState::Loading:
|
||||
// LOADING (numeric value 1)
|
||||
// The text track loading state.
|
||||
return 1;
|
||||
case TextTrack::ReadinessState::Loaded:
|
||||
// LOADED (numeric value 2)
|
||||
// The text track loaded state.
|
||||
return 2;
|
||||
case TextTrack::ReadinessState::FailedToLoad:
|
||||
// ERROR (numeric value 3)
|
||||
// The text track failed to load state.
|
||||
return 3;
|
||||
}
|
||||
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue