LibWeb: Make the value of assignment to media currentTime the rhs value

In cases where a script assigns `x = video.currentTime = y`, we are
expected to have a result of `x === y`, even if the video's duration
is less than y.

According to the spec, this happens because the official playback
position is set to `y` in this case, but since we are following
implementations in making `currentTime` immediately return the position
on the valid media timeline, we have to specifically return the
unchanged value from the setter.

See: https://github.com/whatwg/html/issues/11773
This commit is contained in:
Zaggy1024 2025-10-14 18:28:32 -05:00 committed by Jelle Raaijmakers
parent 9e4c87ab85
commit 93fde59892
Notes: github-actions[bot] 2025-10-28 00:30:45 +00:00
2 changed files with 9 additions and 3 deletions

View file

@ -95,7 +95,7 @@ public:
WebIDL::ExceptionOr<void> load();
double current_time() const;
void set_current_time(double);
double set_current_time(double);
void fast_seek(double);
double current_playback_position() const { return m_current_playback_position; }