
    const promise = video.play();
    assert_stalled_state(true);
    video.src = "";
    // Wait for the video to abort trying to play
    try {
        await promise;
    } catch (err) {}
    await video.pause();
    assert_stalled_state(false);
}, "Test :has(:stalled) invalidation");

promise_test(async (t) => {
    const video = document.querySelector("video");
    assert_buffering_state(false);
    await new Promise((r) => {
        video.addEventListener("stalled", r, { once: true });
        video.s