Open Bug 1319725 Opened 5 years ago Updated 3 months ago

Rework the test_reactivate.html

Categories

(Core :: Audio/Video: Playback, defect, P3)

defect

Tracking

()

People

(Reporter: kaku, Assigned: alwu)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

The test_reactivate.html tests the scenario that invoking play() operation on a no-longer-referenced video element keeps it alive. The play() operation neither work immediately nor fail; it marks the video element as "someone is expecting events from it" so that we should make the video element alive.

However, once the bug 1244768 is completed, invoking a play() operation on a no-longer-referenced video element should fail immediately because we're not able to get the global object of the video element so that we cannot create a DOM promise for the play() operation. 

The original scenario is still valid for seek operation or autoplay mechanism. I will modify the test case to use autoplay mechanism since the W3C is considering modify the seek operation to return a promise, just like the play() operation now.
Assignee: nobody → kaku
Blocks: 1244768
Depends on: 518659
The test_reactivate.html itself does not do what it claims. The `reviveElement()` callback captures the video element and the `reviveElement()` is set to a timer, so the video element won't be GCed. Disable this test case now for implementing bug 1244768 and will rework this test case later.
Comment on attachment 8813926 [details]
Bug 1319725 - disable the test_reactivate.html;

https://reviewboard.mozilla.org/r/95228/#review95484
Attachment #8813926 - Flags: review?(jwwang) → review+
Thanks for the review!
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/03434938bd29
disable the test_reactivate.html; r=jwwang
Keywords: checkin-needed

Bug 518659 introduced this test and provides some context. It seems like the intention is to test the behaviours that keep the element alive (or at least some of them). As noted in comment 0, it sounds like we should migrate this to use autoplay since play() is not going to work anymore. However, since it's been years since this was disabled, it may need more investigation.

NI alwu since he knows autoplay and suggested he could take a look.

Flags: needinfo?(drno)
Flags: needinfo?(alwu)
Assignee: kakukogou → alwu
Flags: needinfo?(bvandyk)
Flags: needinfo?(alwu)
Severity: normal → S4
Keywords: leave-open

When media element's parent document becomes inactive, we would suspend the element [1] and stop dispatching all events [2].

The current test is no longer fitting our current codebase, so we have to rewrite it.

[1] https://searchfox.org/mozilla-central/rev/5a1a34953a26117f3be1a00db20c8bbdc03273d6/dom/html/HTMLMediaElement.cpp#6533-6537
[2] https://searchfox.org/mozilla-central/rev/5a1a34953a26117f3be1a00db20c8bbdc03273d6/dom/html/HTMLMediaElement.cpp#6468

(In reply to Tzuhao Kuo [:kaku] from comment #0)

However, once the bug 1244768 is completed, invoking a play() operation on a
no-longer-referenced video element should fail immediately because we're not
able to get the global object of the video element so that we cannot create
a DOM promise for the play() operation.

I assume that is because the global is obtained from the document, but the global is disconnected from the document when the document is discarded.

However, the HTMLMediaElement's relevant global still exists and should be used to create the promise.
See these examples for how to get the relevant global:
https://hg.mozilla.org/mozilla-central/rev/8e79ee468e4813a2e88fe86d1277a850ff14d066#l1.12
https://hg.mozilla.org/integration/autoland/rev/bbd106f84d51#l1.23

Regressed by: 1244768
You need to log in before you can comment on or make changes to this bug.