Commit Graph

76 Commits

Author SHA1 Message Date
Alastor Wu
55ff87a27e Bug 1535223 - part1 : rename log module's name. r=jya
Use more general name `WebVTT` for this log module, which will include other debug logs in other files later.

Differential Revision: https://phabricator.services.mozilla.com/D23447
2019-03-14 23:21:28 +00:00
Alastor Wu
84b1cfe3b0 Bug 1533909 - part2 : add assertion to ensure we should always get a valid TextTrackCueList. r=jya
In this comparison, we only process `hidden` or `showing` track which should not return null TextTrackCueList.

Differential Revision: https://phabricator.services.mozilla.com/D23087
2019-03-13 05:28:44 +00:00
Alastor Wu
98e01986c3 Bug 1533909 - part1 : 'current cues' should not contain cues which are in the disable track. r=jya
According to the spec [1] step1, `current cues` should only contain cues which are in `hidden` or `showing` track.

[1] https://html.spec.whatwg.org/multipage/media.html#time-marches-on

Differential Revision: https://phabricator.services.mozilla.com/D23086
2019-03-13 05:33:30 +00:00
Alastor Wu
7c3833ba6a Bug 1509446 - part6 : update cues display without checking whether cue is active or not. r=jya
We should update cue display everytime when the cues list changed.

In addition, we shouldn't check whether cue is active when we update display, because it's always inactive when the cue has been removed from `TextTrack::RemoveCue()`.

Differential Revision: https://phabricator.services.mozilla.com/D21143
2019-03-05 19:48:31 +00:00
Alastor Wu
ff7d2dc085 Bug 1509446 - part4 : remove set dirty. r=jya
As the `active cues list` would be automatically contruct when there are any active cues being added or inactive cues being removed, we have no need to use dirty to reset the `active cues list`.

Differential Revision: https://phabricator.services.mozilla.com/D22150
2019-03-07 19:24:02 +00:00
Alastor Wu
fce2ee165c Bug 1509446 - part3 : run 'TimeMarchesOn' directly, instead of queuing a task. r=jya
According to the spec [1], we should run `TimeMarchesOn` algorithm directly when the specific situations happen, the spec doesn't say that we need to queue a task for it.

In addition, all the call sites for `TimeMarchesOn` are on the main thread, so we don't need to worry about race condition.

[1]
https://html.spec.whatwg.org/multipage/media.html#playing-the-media-resource:time-marches-on-2
https://html.spec.whatwg.org/multipage/media.html#playing-the-media-resource:time-marches-on-3
https://html.spec.whatwg.org/multipage/media.html#playing-the-media-resource:time-marches-on-4

Differential Revision: https://phabricator.services.mozilla.com/D22149
2019-03-08 03:12:42 +00:00
Alastor Wu
a7aae22660 Bug 1509446 - part2 : use current cue in 'TimeMarchesOn' algorithm. r=jya
According to the spec [1], the `current cue` is not equal with the `active cue`, because it might contain non active cues, which might be set to active later during the `TimeMarchesOn`.

The `current cue` should be a list of cues, initialized to contain all the cues of all the hidden or showing text tracks of the media element (not the disabled ones) whose start times are less than or equal to the current playback position and whose end times are greater than the current playback position.

[1] https://html.spec.whatwg.org/multipage/media.html#time-marches-on

Differential Revision: https://phabricator.services.mozilla.com/D22148
2019-03-07 19:21:22 +00:00
Alastor Wu
b4799c7bc3 Bug 1509446 - part1 : update active cues list when cue's active state changed. r=jya
According to spec [1], `activeCues` should represent a subset of the text track cues whose active flag was set when the script started.

We should only depend on the `TimeMarchesOn` algorithm which will change cue's active state, and then add or remove cue to `activeCues`.

[1] https://html.spec.whatwg.org/multipage/media.html#dom-texttrack-activecues

Differential Revision: https://phabricator.services.mozilla.com/D22147
2019-03-08 03:10:45 +00:00
Peter Van der Beken
a3fa6a450e Bug 1521848 - Replace nsTArrayToJSArray with ToJSValue. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D17263
2019-01-22 18:36:07 +00:00
Jean-Yves Avenard
97d5b62fcf Bug 1443429 - P1. Ensure that we don't run JS wrapper while in stable state. r=pehrsons
Due to the state watcher logic, mirror tasks can be dispatched while in stable state. We must not have visible aJS change during such stable state.

Differential Revision: https://phabricator.services.mozilla.com/D12699
2018-12-13 20:04:46 +00:00
Sylvestre Ledru
e5a134f73a Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset
2018-11-30 11:46:48 +01:00
Andrew McCreight
427171c79e Bug 1504365 - Clear weak pointers in shutdown observers. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D12348
2018-11-19 23:16:24 +00:00
Timothy Guan-tin Chien
6d1c85846d Bug 1491066 - Allow TextTrackManager to pass cue without videocontrols r=alwu
With UA Widget, the videocontrols container is created lazily.
It won't be a problem for WebVTT.processCues() in vtt.jsm, so
TextTrackManager::UpdateCueDisplay() should not early return there, but pass
nullptr to it.

Differential Revision: https://phabricator.services.mozilla.com/D3667
2018-09-13 22:38:43 +00:00
Timothy Guan-tin Chien
3d96218b5e Bug 1431255 - Part II, Create a Shadow Root in HTMLMediaElement when enabled, skipping <xul:videocontrols> r=dholbert,smaug
This prevents XBL binding from being attached, and create the Shadow Root to
host controls to be created by the script.

Shadow Root and the JS controls are lazily constructed when the controls
attribute is set.

Set nsVideoFrame as dynamic-leaf so it will ignore content child frames when
the controls are XBL anonymous content, and handles child frames from controls
in the Shadow DOM. The content nodes are still ignored since there is no
<slot>s in our Shadow DOM.

MozReview-Commit-ID: 3hk41iMa07n
2018-06-27 11:12:38 -07:00
Boris Zbarsky
5f0f9d3fb4 Bug 1429903 part 4. Remove nsIDOMEventTarget. r=mccr8
MozReview-Commit-ID: 9XuenUHxfPx
2018-04-20 00:49:30 -04:00
Boris Zbarsky
65759d684b Bug 1455055 part 1. Convert nsIDOMEventListener to taking an Event, not an nsIDOMEvent. r=masayuki
This does no cleanup other than what's needed to compile.  Cleanup coming up in
later patches.

MozReview-Commit-ID: 3sOnkj71n09
2018-04-20 00:49:29 -04:00
Andrea Marchesini
8d41475807 Bug 1430997 - Rename nsINode::IndexOf to nsINode::ComputeIndexOf, r=catalinb 2018-01-23 14:30:18 +01:00
Chris Peterson
677bf4030c Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj
MozReview-Commit-ID: DCPTnyBooIe
2017-11-05 19:37:28 -08:00
Alastor Wu
b001a5a837 Bug 1382574 - part2 : remove HTMLMediaElement::GetHasUserInteraction(). r=bechen
MozReview-Commit-ID: 3MaumQvcR1q
2017-11-22 00:33:20 +08:00
Nika Layzell
d8c117bc28 Bug 1414974 - Part 2: Switch many consumers to nsGlobalWindow{Inner,Outer}, r=smaug
This is a large patch which tries to switch many of the external consumers of
nsGlobalWindow to instead use the new Inner or Outer variants.

MozReview-Commit-ID: 99648Lm46T5
2017-11-09 10:44:47 -05:00
Bevis Tseng
96aaed1a3c Bug 1394349 - Label dom::SimpleTextTrackEvent with its associated inner window. r=billm 2017-08-28 17:22:20 +08:00
bechen@mozilla.com
5c83066d94 Bug 1385092 - Null check for the sParserWrapper. r=alwu
From the crash report and code logic, it is possible that the KillClearOnShutdown comes and the NS_XPCOM_SHUTDOWN_OBSERVER_ID never comes when getting obsercerService fail.
So add null check for the sParserWrapper and combine mShutdown to a new function.

MozReview-Commit-ID: Cj5ph2JrO7v
2017-08-09 17:30:52 +08:00
Carsten "Tomcat" Book
3fe83e45ea merge mozilla-inbound to mozilla-central a=merge 2017-07-27 10:57:25 +02:00
Bevis Tseng
2ecbda13e2 Bug 1378930 - Part 2: Remove the aName parameter from SchedulerGroup/DocGroup/DispatcherTrait. r=billm 2017-07-26 16:13:35 +08:00
Kartikaya Gupta
14424677af Bug 1384233 - Remove SizePrintfMacros.h. r=froydnj
We have a minimum requirement of VS 2015 for Windows builds, which supports
the z length modifier for format specifiers. So we don't need SizePrintfMacros.h
any more, and can just use %zu and friends directly everywhere.

MozReview-Commit-ID: 6s78RvPFMzv
2017-07-26 16:03:57 -04:00
Bill McCloskey
ce42826bdf Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-26 14:19:58 -07:00
Carsten "Tomcat" Book
238bf154d5 Backed out changeset 4f6302a98ae4 (bug 1372405) 2017-06-21 13:59:26 +02:00
Bill McCloskey
67e8af4720 Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-20 21:44:11 -07:00
Carsten "Tomcat" Book
bbe9441993 Backed out changeset 9846de3bd954 (bug 1372405) 2017-06-20 08:27:02 +02:00
Bill McCloskey
f69608368b Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-19 22:25:47 -07:00
bechen
4db4e2b3e3 Bug 1368489 - Fixing TimeMarchesOn step 13, sort the tasks by "text track cue order". r=rillian.
1. Sort by TextTrack. 2. Sort by time. 3. Sort by the order of added to TextTrack.

MozReview-Commit-ID: 4nwx6U5dMpy
2017-06-13 09:52:27 +08:00
bechen
30c6754f04 Bug 1325001 - TextTrackList::GetShowingCues should return cues whose kind is Subtitles or Captions. r=rillian
We should only render the Subtitles/Captions cue on the screen. In addition, rename the activeCues to showingCues.
Because the meaning of "active" and "showing" are different. Showing means we can see the cue on the screen, active means the current playback time touches the cue.

MozReview-Commit-ID: 1BfHhxFXBDP
2017-05-22 11:30:22 +08:00
bechen
7a5d6fe640 Bug 1364185 - Call DispatchUpdateCueDisplay() in TextTrackManager::NotifyCueUpdated. r=alwu
If the video is paused, then set the "TextTrack.mode=hidden/showing", in this case, TimeMarchesOn will return at step 7,
not update the screen. So call DispatchUpdateCueDisplay explicitly to update the screen.

MozReview-Commit-ID: IuazaeSXX31
2017-05-17 14:57:51 +08:00
bechen
b96882816b Bug 1343797 - Label runnables in TextTrackManager.cpp. r=jwwang
MozReview-Commit-ID: 2rP55aUyNi
2017-03-27 16:51:17 +08:00
bechen
e7707bafc3 Bug 1334112 - part1: Add IsLoaded functions for TextTrack, TextTrackList, TextTrackManager. r=rillian
MozReview-Commit-ID: GBEKZvLUiPn
2017-02-20 15:27:06 +08:00
Tom Tromey
a4b717ab39 Bug 1060419 - make log_print use Printf.h, r=froydnj
MozReview-Commit-ID: BIZ1GQEZ1vs
2016-12-15 20:16:31 -07:00
Ralph Giles
f4801cef5f Bug 1333931 - Handle nullptr TextTrack objects in sorting. r=kinetik
Check for nullptr arguments passed to CompareTextTracks. Based
on Ben Kelly's analysis this can happen if the cycle collector
has cleared a TextTrack pointer while comparision is still
happening, perhaps in a queued event task.

This change makes nullptr sort to the end, and adds a
MOZ_DIAGNOSTIC_ASSERT for trying to get the position
of a nullptr track should someone add another call at
a later date.
2017-01-31 17:24:17 -08:00
bechen
6b22fabee8 Bug 1329117 - Run HonorUserPreferencesForTrackSelection at stable state. r=jwwang
MozReview-Commit-ID: FwZyHHFa8KD
2017-01-23 11:12:22 +08:00
bechen
4ad2bfb27c Bug 1310162 - mTrack in SimpleTextTrackEvent might be null. r=jwwang
MozReview-Commit-ID: ESqYqBem7kQ
2016-12-28 15:51:37 +08:00
bechen
f68820a82c Bug 1304948 - Part 2: Don't run TimeMarchesOn when shutdown. r=rillian
MozReview-Commit-ID: AE6FE74ESHN
2016-09-29 17:47:33 +08:00
Paul Bignier
be164c144a Bug 1305674 - initialize mUpdateCueDisplayDispatched. r=mrbkap
* There is no visible initializer function to that class so the variable could be accessed to, uninitialized
2016-09-27 12:19:17 +02:00
bechen
dae08cf497 Bug 1275492 - Add logs for TextTrackManager. r=jwwang
MozReview-Commit-ID: LyNTDhjj0fR
2016-08-25 10:58:49 +08:00
bechen
bf02f3914b Bug 1294142 - TextTrackManager::mTextTracks is null after CC. r=jwwang
MozReview-Commit-ID: 7EU54n1erpZ
2016-08-11 18:09:06 +08:00
bechen
eac7c9268a Bug 1285897 - Async dispatch cuechange event on TextTrack object. r=rillian
MozReview-Commit-ID: DKWCAEaT58J
2016-07-12 17:41:41 +08:00
Carsten "Tomcat" Book
4241e83a8a Backed out changeset 5c7dda18ec02 (bug 1285897) 2016-07-21 08:03:10 +02:00
bechen
726efd3dd1 Bug 1285897 - Async dispatch cuechange event on TextTrack object. r=rillian
MozReview-Commit-ID: DKWCAEaT58J
2016-07-12 17:41:41 +08:00
bechen
6a5de816db Bug 1281999 - Update the display when we remove an active cue by changing the texttrackmode to disabled. r=rillian
MozReview-Commit-ID: GeF5Icd9jLu
2016-07-18 15:39:14 +08:00
Alastor Wu
d767ac8e41 Bug 1280644 - part2 : modify naming and add scope indentifier. r=rillian
MozReview-Commit-ID: 9ysNb5SiQOP
2016-07-11 10:51:13 +08:00
Alastor Wu
b698b3ba71 Bug 1280644 - part1 : add Telemetry for webvtt. r=bsmedberg,rillian
MozReview-Commit-ID: 4a6JmfolqkW
2016-07-11 10:51:08 +08:00
bechen
a475af3cfd Bug 1279865 - Don't run TimeMarchesOn if the MediaElement is not played. r=rillian
1. If mHasUserInteraction MediaElement is false, don't run the TimeMarchesOn because the element is not played. 2. Update the activeCueList only in TimeMarchesOn(). 3. Run TimeMarchesOn() at the beginning of play. r=rillian

MozReview-Commit-ID: BhwsIfRm3B2
2016-06-30 13:31:56 +08:00