Closed Bug 871747 Opened 11 years ago Closed 8 years ago

[webvtt] should HTMLTrackElement load resources outside a document?

Categories

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

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla50
Tracking Status
firefox50 --- fixed

People

(Reporter: rillian, Assigned: bechen)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete)

Attachments

(2 files, 1 obsolete file)

HTMLTrackElement::BindToTree() only tries to load a resource if aDocument is non-null. This is cargo-culted from HTMLMediaElement::BindToTree() where the same conditional was added in bug 503989.

Per irc discussion, bz's reading of the spec is that the load should fire whether the element has a parent document or not, and so the conditional on aDocument should be removed.

Before we do that, I want to understand if the spec is correct here.
Roc, do you remember why you added HTMLMediaElement;:BindToTree() check in bug 503989?
Flags: needinfo?(roc)
I don't remember. If we don't leak with that check taken out, I think you should take it out.
Flags: needinfo?(roc)
Test patch removing the check from HTMLMediaElement.

Pushed to try as https://tbpl.mozilla.org/?tree=Try&rev=9804b644c799 to check for leaks.
Comment on attachment 749309 [details] [diff] [review]
remove aDocument check from HTMLMediaElement::BindToTree

My patch is silly, and crashes on content/canvas/test/crossorigin/test_video_crossorigin.html dereferencing a null aDocument.

https://tbpl.mozilla.org/?tree=Try&rev=ccf39027a215
Attachment #749309 - Flags: review-
Component: Audio/Video → Audio/Video: Playback
Blocks: 1278151
Blocks: 1281406
Assignee: nobody → bechen
https://dxr.mozilla.org/mozilla-central/source/dom/html/HTMLTrackElement.cpp#266

The TrackElement call MediaElement::RunInStableState is not correct. Because the MediaElement::AbortExistingLoads will cancel the runnable of stable state by adding |mCurrentLoadID|. 
So the TrackElement::LoadResource should not use MediaElement::RunInStableState regardless inside/outside document.

ex:
v is MediaElement,t is TrackElement.
//
v.appendChild(t); // trigger HTMLTrackElement::BindToTree, dispatch a task to stable state.
v.src = xxx; // trigger the AbortExistingLoads, the t won't load any resource because the task be cancelled.
//
Attachment #749309 - Attachment is obsolete: true
Attachment #8765395 - Flags: review?(giles) → review+
Comment on attachment 8765395 [details]
Bug 871747 - Load the TrackElement outside the document.

https://reviewboard.mozilla.org/r/60794/#review57724

Thanks for fixing this.
Comment on attachment 8765396 [details]
Bug 871747 - Enable html/semantics/embedded-content/media-elements/interfaces/TextTrackList/getter.html, TextTrack/cues.html, TextTrackList/length.html, track/track-element/cloneNode.html, query-encoding/utf-8.html, utf-16be.html, utf-16le.html, windows-1

https://reviewboard.mozilla.org/r/60796/#review57726
Attachment #8765396 - Flags: review?(giles) → review+
Comment on attachment 8765395 [details]
Bug 871747 - Load the TrackElement outside the document.

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/60794/diff/1-2/
Comment on attachment 8765396 [details]
Bug 871747 - Enable html/semantics/embedded-content/media-elements/interfaces/TextTrackList/getter.html, TextTrack/cues.html, TextTrackList/length.html, track/track-element/cloneNode.html, query-encoding/utf-8.html, utf-16be.html, utf-16le.html, windows-1

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/60796/diff/1-2/
Comment on attachment 8765395 [details]
Bug 871747 - Load the TrackElement outside the document.

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/60794/diff/2-3/
Attachment #8765396 - Attachment description: Bug 871747 - Enable html/semantics/embedded-content/media-elements/interfaces/TextTrackList/getter.html, TextTrack/cues.html, TextTrackList/length.html. → Bug 871747 - Enable html/semantics/embedded-content/media-elements/interfaces/TextTrackList/getter.html, TextTrack/cues.html, TextTrackList/length.html, track/track-element/cloneNode.html.
Comment on attachment 8765396 [details]
Bug 871747 - Enable html/semantics/embedded-content/media-elements/interfaces/TextTrackList/getter.html, TextTrack/cues.html, TextTrackList/length.html, track/track-element/cloneNode.html, query-encoding/utf-8.html, utf-16be.html, utf-16le.html, windows-1

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/60796/diff/2-3/
Comment on attachment 8765396 [details]
Bug 871747 - Enable html/semantics/embedded-content/media-elements/interfaces/TextTrackList/getter.html, TextTrack/cues.html, TextTrackList/length.html, track/track-element/cloneNode.html, query-encoding/utf-8.html, utf-16be.html, utf-16le.html, windows-1

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/60796/diff/3-4/
Attachment #8765396 - Attachment description: Bug 871747 - Enable html/semantics/embedded-content/media-elements/interfaces/TextTrackList/getter.html, TextTrack/cues.html, TextTrackList/length.html, track/track-element/cloneNode.html. → Bug 871747 - Enable html/semantics/embedded-content/media-elements/interfaces/TextTrackList/getter.html, TextTrack/cues.html, TextTrackList/length.html, track/track-element/cloneNode.html, query-encoding/utf-8.html, utf-16be.html, utf-16le.html, windows-1…
Comment on attachment 8765396 [details]
Bug 871747 - Enable html/semantics/embedded-content/media-elements/interfaces/TextTrackList/getter.html, TextTrack/cues.html, TextTrackList/length.html, track/track-element/cloneNode.html, query-encoding/utf-8.html, utf-16be.html, utf-16le.html, windows-1

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/60796/diff/4-5/
Attachment #8765396 - Attachment description: , windows-1 → , windows-1251.html, windows-1252.html.
Keywords: checkin-needed
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ad45d87d0b34
Load the TrackElement outside the document. r=rillian
https://hg.mozilla.org/integration/mozilla-inbound/rev/78e63a1be0b9
Enable html/semantics/embedded-content/media-elements/interfaces/TextTrackList/getter.html, TextTrack/cues.html, TextTrackList/length.html, track/track-element/cloneNode.html, query-encoding/utf-8.html, utf-16be.html, utf-16le.html, windows-1251.html, windows-1252.html. r=rillian
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/ad45d87d0b34
https://hg.mozilla.org/mozilla-central/rev/78e63a1be0b9
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
Depends on: CVE-2017-7750
Depends on: 1362924
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: