commit ef202a2e6f99a85b13d4352f84a8a357471130c2
parent 15b49aaf642cae56e7eb7218d10123bec76a9c71
Author: Andrei Volykhin <andrei.volykhin@gmail.com>
Date: Sat, 22 Nov 2025 21:11:21 +0000
Bug 2001363 [wpt PR 56139] - html: The queued <media> `volumechange` event should be cancellable, a=testonly
Automatic update from web-platform-tests
html: The queued <media> `volumechange` event should be cancellable
Following the HTML specification, on the `volume` or `mute`
attrubute changes the user agent must queue a media element
task given the media element to fire an event named
`volumechange` at the media element (the `generation_id`
value will be captured to allow cancel this task -
`media-element-load-algorithm` steps 3-5)
See https://html.spec.whatwg.org/multipage/#event-media-volumechange
See https://html.spec.whatwg.org/multipage/#media-element-load-algorithm
Changed the naming of the `playbackRate` and `defaultPlaybackRate`
members to match Rust naming conventions (`snake_case`).
Testing: Added the `cancellable` subtest to `event_volumechange` test
- html/semantics/embedded-content/media-elements/event_volumechange.html
Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
--
wpt-commits: 5408908047a48c5eae30d07b5266afaf7c841993
wpt-pr: 56139
Diffstat:
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_volumechange.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/event_volumechange.html
@@ -65,6 +65,17 @@ function volumechange_test(tagName) {
}
});
}, "setting " + tagName + ".volume/muted repeatedly fires volumechange repeatedly");
+
+ async_test(function(t) {
+ var e = document.createElement(tagName);
+ e.muted = !e.muted;
+ e.volume = 1 - e.volume;
+ e.load();
+ e.onvolumechange = t.unreached_func();
+ t.step_timeout(() => {
+ t.done();
+ }, 1000);
+ }, "setting " + tagName + ".volume/muted before load will not fire volumechange");
}
volumechange_test("audio");