Commit graph

1028 commits

Author SHA1 Message Date
Christoph Kerschbaumer
54df1cb98c Bug 1528677: Remove nullchecks for loadinfo since we have loadinfo on all channels. r=baku 2019-02-20 13:27:25 +01:00
Jonathan Kingston
3421b8fcff Bug 1520868 - Replacing AsyncOpen2 with AsyncOpen always r=valentin
Replacing js and text occurences of asyncOpen2
Replacing open2 with open

Differential Revision: https://phabricator.services.mozilla.com/D16885

--HG--
rename : layout/style/test/test_asyncopen2.html => layout/style/test/test_asyncopen.html
extra : moz-landing-system : lando
2019-02-12 16:08:25 +00:00
Andrea Marchesini
43a5f36077 Bug 1522210 - Fingerprinting and cryptomining classifiers must have separate nsIWebProgressListener blocking state codes - part 1 - UrlClassifierFeatureFactory::IsClassifierBlockingErrorCode, r=ehsan
Differential Revision: https://phabricator.services.mozilla.com/D17637
2019-01-30 13:43:34 +01:00
Timothy Guan-tin Chien
d59f80985c Bug 1507895 - Part I, Remove the videocontrols binding r=smaug
This patch removes the XBL videocontrols binding and make <video>
to always use the UA Widget to generate controls.

DevTools tests that look for NAC is switched to use <input type=file>.

Differential Revision: https://phabricator.services.mozilla.com/D17571

--HG--
extra : moz-landing-system : lando
2019-01-25 13:12:26 +00:00
Ehsan Akhgari
e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
alwu
ab5249684b Bug 1513733 - part2 : try to start AudioContext when media element which is as a source for web audio starts r=cpearce,karlt
If media element is used as a source for AudioContext, we would try to start AudioContext which was not allowed
to start when media element starts playing.

Differential Revision: https://phabricator.services.mozilla.com/D14593

--HG--
extra : moz-landing-system : lando
2019-01-11 20:43:01 +00:00
Andreas Pehrson
8b813e9e30 Bug 1515068 - Allow UpdateSrcStreamTime while paused. r=jya
This can legitimately happen while paused since the watchmanager calling this
is dispatching the calls. As such they're out of sync with the paused state,
and we need to allow updating the time while paused.

FireTimeUpdate does ignore the call if the time hasn't actually been updated,
so the only impact from this is that we could do a lot of unnecessary
dispatching while paused without noticing.

Differential Revision: https://phabricator.services.mozilla.com/D15731

--HG--
extra : moz-landing-system : lando
2019-01-09 17:15:18 +00:00
alwu
2e3f453263 Bug 1513039 - part5 : log warning when autoplay is blocked. r=cpearce,karlt
Wrap 'nsContentUtils::ReportToConsole()' to reduce necessary input parameters and call it when we need to log error or warning message. Show the warning when autoplay is blocked.

For web audio, this restores the console messages removed in part4 and also reports the same message when the AudioContext is blocked in the constructor.

Differential Revision: https://phabricator.services.mozilla.com/D14330

--HG--
extra : moz-landing-system : lando
2019-01-07 19:57:48 +00:00
alwu
2f88c125de Bug 1513039 - part3 : remove permission request codes in MediaElement. r=cpearce
Depends on D14326

Differential Revision: https://phabricator.services.mozilla.com/D14327

--HG--
extra : moz-landing-system : lando
2019-01-07 18:32:42 +00:00
Alastor Wu
4d16da70e0 Bug 1513681 - part1 : dispatch 'GloballyAutoplayBlocked' event when site is blocked r=cpearce,smaug
This event is used to notify tab that this site is blocked and we should show the blocking icon for it. Patch2 will handle following details.

Differential Revision: https://phabricator.services.mozilla.com/D14794

--HG--
extra : moz-landing-system : lando
2019-01-04 19:05:52 +00:00
Emilio Cobos Álvarez
d2ed260822 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Bogdan Tara
6defca7262 Backed out 5 changesets (bug 1513681) for browser_autoplay_blocked.js failures CLOSED TREE
Backed out changeset d24ddb803761 (bug 1513681)
Backed out changeset 6f52b229d953 (bug 1513681)
Backed out changeset 79a78732c3ac (bug 1513681)
Backed out changeset d0a9422928ae (bug 1513681)
Backed out changeset 23b5a58e3bcc (bug 1513681)

--HG--
rename : toolkit/actors/AutoplayChild.jsm => toolkit/actors/AudibleAutoplayChild.jsm
2018-12-29 04:00:53 +02:00
alwu
6f035acde6 Bug 1513681 - part1 : dispatch 'GloballyAutoplayBlocked' event when site is permanent blocked. r=cpearce,smaug
This event is used to notify tab that this site is permanently blocked and we should show the blocking icon for it. Patch2 will handle following details.

Differential Revision: https://phabricator.services.mozilla.com/D14794

--HG--
extra : moz-landing-system : lando
2018-12-18 18:11:56 +00:00
Alastor Wu
862fdf36a9 Bug 1511235 - part3 : ensure video is visible before starting test r=jya,baku
Add testing function to know whether video is visible or not.

Differential Revision: https://phabricator.services.mozilla.com/D14667

--HG--
extra : moz-landing-system : lando
2018-12-21 06:40:10 +00:00
alwu
16fe01f1fd Bug 1511235 - part2 : add test. r=jya,baku
Add new webidl method for testing only and a test.

Differential Revision: https://phabricator.services.mozilla.com/D13805

--HG--
extra : moz-landing-system : lando
2018-12-20 20:01:46 +00:00
Timothy Guan-tin Chien
3913ded230 Bug 1510848 - Do not unattach UA Widget Shadow Root if the element is already re-attached to the tree r=emilio,smaug
This patch moves all UA Widget calls to helper functions in Element.cpp. The helper function AttachAndSetUAShadowRoot sets the shadow root in a runnable, so that it is in the same order of NotifyUAWidget* runnables.

Differential Revision: https://phabricator.services.mozilla.com/D13479

--HG--
extra : moz-landing-system : lando
2018-12-15 02:48:46 +00:00
Jean-Yves Avenard
1eaf0bea3e Bug 1443429 - P4. Ensure MediaShutdownManager is initialized outside stable state. r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D14283

--HG--
extra : moz-landing-system : lando
2018-12-13 20:06:03 +00:00
Jean-Yves Avenard
b6b646428c 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

--HG--
extra : moz-landing-system : lando
2018-12-13 20:04:46 +00:00
Cosmin Sabou
0bedc24aae Backed out 2 changesets (bug 1511235) for causing bugs 1513454, 1513456 as alwu requested on irc. a=backout
Backed out changeset 4c9f874d6868 (bug 1511235)
Backed out changeset 3432e8bee7f1 (bug 1511235)
2018-12-13 03:43:36 +02:00
alwu
aba79e9edc Bug 1511235 - part2 : add test. r=jya,baku
Add new webidl method for testing only and a test.

Differential Revision: https://phabricator.services.mozilla.com/D13805

--HG--
extra : moz-landing-system : lando
2018-12-12 02:16:55 +00:00
Sylvestre Ledru
265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Timothy Guan-tin Chien
3c5974c14a Bug 1508000 - Dispatch UAWidgetUnbindFromTree event before calling nsGenericHTMLElement::UnbindFromTree() r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D12205

--HG--
rename : toolkit/content/tests/widgets/test_ua_widget.html => toolkit/content/tests/widgets/test_ua_widget_sandbox.html
extra : moz-landing-system : lando
2018-11-28 02:29:38 +00:00
Andreas Pehrson
ec8fc95487 Bug 1423241 - Unify decoder and stream paths in HTMLMediaElement::AddRemoveSelfReference. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D12287

--HG--
extra : moz-landing-system : lando
2018-11-23 15:03:21 +00:00
Andreas Pehrson
9a86a15c6f Bug 1423241 - Remove OnTracksAvailableCallback from HTMLMediaElement. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D12277

--HG--
extra : moz-landing-system : lando
2018-11-23 15:02:23 +00:00
Andreas Pehrson
4213b7db86 Bug 1423241 - Refactor DecodedStream. r=jya
This removes DecodedStream's use of MediaStreamListener in favor of
MediaStreamTrackListener. This change has however rippled through to a lot
more cleanup, per below.

This moves the MediaStreamTrack lifetime ownership for captured
HTMLMediaElements from the media element to DecodedStream, where the
MediaStreamGraph-side tracks are already created and ended today.

This makes MediaStreamTrack creation explicit across the entire codebase and
lets us remove the MediaStreamTrackSourceGetter class and the infrastructure
of adding MediaStreamTracks after they've already been created in the graph
from DOMMediaStream.

With track ownership, and thus TrackID allocation ownership, happening
exclusively in DecodedStream for its output tracks, we also stop throwing
away and recreating the SourceMediaStream to which we feed data on seek.
This is one step closer to fixing bug 1172394 and spec compliance of
HTMLMediaElement.captureStream().

Differential Revision: https://phabricator.services.mozilla.com/D12273

--HG--
extra : moz-landing-system : lando
2018-11-23 15:02:03 +00:00
Andreas Pehrson
8a424abbee Bug 1423241 - Hold back readyState while no frame has been displayed as intended. r=jya
HasVideo() might be false even though there is a video track present as it will
only look at the resolution of a VideoTrack.

Differential Revision: https://phabricator.services.mozilla.com/D9103

--HG--
extra : moz-landing-system : lando
2018-11-23 15:01:24 +00:00
Andreas Pehrson
26308e92bf Bug 1423241 - Remove screen-wakelock code that no longer has an effect. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D9102

--HG--
extra : moz-landing-system : lando
2018-11-23 15:01:18 +00:00
Andreas Pehrson
84905ffbe9 Bug 1423241 - Expose MSG's GraphTime through main-thread-Watchable and move media element to it. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D9101

--HG--
extra : moz-landing-system : lando
2018-11-23 15:01:13 +00:00
Andreas Pehrson
2561e93cdb Bug 1423241 - Remove a rawptr in HTMLMediaElement. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D9099

--HG--
extra : moz-landing-system : lando
2018-11-23 15:00:55 +00:00
Andreas Pehrson
5d81eeb138 Bug 1423241 - Remove HTMLMediaElement::StreamListener::NotifyHasCurrentData. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D9098

--HG--
extra : moz-landing-system : lando
2018-11-23 15:00:49 +00:00
Andreas Pehrson
afdaeed6d7 Bug 1423241 - Rename StreamSizeListener to VideoFrameListener and minor cleanup. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D9096

--HG--
extra : moz-landing-system : lando
2018-11-23 15:00:43 +00:00
Andreas Pehrson
58f77e6354 Bug 1423241 - Implement HTMLMediaElement::IsPlaybackEnded and IsEnded properly for MediaStreams. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D9095

--HG--
extra : moz-landing-system : lando
2018-11-23 15:00:37 +00:00
Andreas Pehrson
aa6d9c24a0 Bug 1423241 - Move special media element captureStream handling of inactive stream out of MediaStreamGraph. r=jib
Differential Revision: https://phabricator.services.mozilla.com/D12264

--HG--
extra : moz-landing-system : lando
2018-11-23 14:59:56 +00:00
Jean-Yves Avenard
d05f000f1b Bug 1507093 - P4. Don't lazily allocate mVideoTrackList and mAudioTrackList. r=pehrsons
Should the media element be cycle collected and a decoder still be active, a change of state could have caused the track list to be re-created causing a cycle between the HTMLMediaElement and the track list.

We also check when potentially updating the ready state if the self reference is still needed.

Place various assertions.

Differential Revision: https://phabricator.services.mozilla.com/D11860

--HG--
extra : moz-landing-system : lando
2018-11-15 12:48:34 +00:00
Jean-Yves Avenard
bc18f07d03 Bug 1507093 - P3. Ensure that self AddRef/DeRef occur sequentially r=pehrsons
It was possible for two sequential calls to HTMLMediaElement::AddRemoveSelfReference to leave the media element deregistered when it should have registered.
And we ensure to ony ever self register once.

Differential Revision: https://phabricator.services.mozilla.com/D11859

--HG--
extra : moz-landing-system : lando
2018-11-15 12:48:11 +00:00
Jean-Yves Avenard
25ba5304be Bug 1494073 - Always clamp playbackrate when setting decoder. r=padenot
We were clamping the playback rate properly if the decoder had been setup already, but not if setting it before playback started.

Differential Revision: https://phabricator.services.mozilla.com/D11005

--HG--
extra : moz-landing-system : lando
2018-11-07 13:56:25 +00:00
Alexander Surkov
3395e926b6 Bug 1497940 - add nsGenericHTMLElement::AttachAndSetUAShadowRoot helper method, r=smaug 2018-11-02 12:18:20 +08:00
Alex Chronopoulos
13c885d7b1 Bug 1498679 - Stop moving variable to fix Linux64 debug coverage build. r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D9244

--HG--
extra : moz-landing-system : lando
2018-10-19 12:47:06 +00:00
Alex Chronopoulos
5580e3fad1 Bug 934425 - Implement setSinkId in HTMLMediaElement. r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D5874

--HG--
extra : moz-landing-system : lando
2018-10-12 09:39:30 +00:00
alwu
f9668b6e7e Bug 1495064 - part2 : don't request wakelock for video without audio track. r=jya
There are often websites using videos without an audio track as background image or as GIF-like image. For these cases,
we don't want to hold a wakelock.

Differential Revision: https://phabricator.services.mozilla.com/D7215

--HG--
extra : moz-landing-system : lando
2018-10-02 17:55:50 +00:00
alwu
985d65ec0c Bug 1495064 - part1 : refactor the logic of requesting wakelock. r=jya
HTMLMediaElement::UpdateWakeLock() is responsible for creating and releasing audio wakelock.
HTMLVideoElement::UpdateWakeLock() is responsible for creating and releasing video wakelock.

In addition, each platform would handle system wakelock properly depending on different requests.

Differential Revision: https://phabricator.services.mozilla.com/D7214

--HG--
extra : moz-landing-system : lando
2018-10-02 17:56:21 +00:00
Jan-Ivar Bruaroey
dec32ffaaf Bug 1497149 - Don't refcount runnables unnecessarily in Async[Resolve|Reject]SeekDOMPromiseIfExists. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D8025

--HG--
extra : moz-landing-system : lando
2018-10-08 19:53:08 +00:00
Jan-Ivar Bruaroey
32f97763a0 Bug 1497149 - Avoid nulling mSeekDOMPromise on OOM, and use IgnoreErrors(). r=jya
Differential Revision: https://phabricator.services.mozilla.com/D8021

--HG--
extra : moz-landing-system : lando
2018-10-08 19:39:41 +00:00
Jan-Ivar Bruaroey
fd1e15d444 Bug 1495904 - Have HTMLMediaElement::Seek() return synchronous errors synchronously instead of causing uncatchable promise rejections in web console. Enforce existing fastSeek() and mediaElement.currentPosition = value behavior (which is to ignore... r=pehrsons
...errors) if srcObject is a MediaStream. r?pehrsons

Differential Revision: https://phabricator.services.mozilla.com/D7566

--HG--
extra : moz-landing-system : lando
2018-10-05 15:43:32 +00:00
Nathan Froyd
846d8789ee Bug 1492894 - part 1 - make the node hierarchy consistently constructed with NodeInfo&&; r=mccr8
Various places in dom/ use the pattern:

  already_AddRefed<NodeInfo> ni = ...;

which is supposed to be disallowed by our static analysis code, but
isn't, for whatever reason.  To fix our static analysis code, we need to
eliminate instances of the above pattern.

Unfortunately, eliminating this pattern requires restructuring how Nodes
are created.  Most Node subclasses take `already_AddRefed<NodeInfo>&` in
their constructors, and a few accept `already_AddRefed<NodeInfo>&&`.  We
need to enforce the latter pattern consistently, which requires changing
dozens of source files.
2018-09-21 16:45:49 -04:00
Nathan Froyd
e7b3b3140d Bug 1415980 - make hash keys movable and not copyable; r=erahm
Everything that goes in a PLDHashtable (and its derivatives, like
nsTHashtable) needs to inherit from PLDHashEntryHdr. But through a lack
of enforcement, copy constructors for these derived classes didn't
explicitly invoke the copy constructor for PLDHashEntryHdr (and the
compiler didn't invoke the copy constructor for us). Instead,
PLDHashTable explicitly copied around the bits that the copy constructor
would have.

The current setup has two problems:

1) Derived classes should be using move construction, not copy
   construction, since anything that's shuffling hash table keys/entries
   around will be using move construction.

2) Derived classes should take responsibility for transferring bits of
   superclass state around, and not rely on something else to handle that.

The second point is not a huge problem for PLDHashTable (PLDHashTable
only has to copy PLDHashEntryHdr's bits in a single place), but future
hash table implementations that might move entries around more
aggressively would have to insert compensation code all over the
place. Additionally, if moving entries is implemented via memcpy (which
is quite common), PLDHashTable copying around bits *again* is
inefficient.

Let's fix all these problems in one go, by:

1) Explicitly declaring the set of constructors that PLDHashEntryHdr
   implements (and does not implement). In particular, the copy
   constructor is deleted, so any derived classes that attempt to make
   themselves copyable will be detected at compile time: the compiler
   will complain that the superclass type is not copyable.

This change on its own will result in many compiler errors, so...

2) Change any derived classes to implement move constructors instead of
   copy constructors. Note that some of these move constructors are,
   strictly speaking, unnecessary, since the relevant classes are moved
   via memcpy in nsTHashtable and its derivatives.
2018-09-20 11:20:36 -04:00
alwu
1506a7fce4 Bug 1477767 - disconnect request when XPCOM is going to shutdown. r=cpearce
The reason we hit this assertion is that we still connected to Then() and waited for its result when the resolve or reject
runnable which dispatched by ThenValue can't be executed because the target thread had been shutdown.

Therefore, when XPCOM is going to shutdown, we should disconnect the Then() because it might not have a chance to execute
its resolve/reject method.

Differential Revision: https://phabricator.services.mozilla.com/D5893

--HG--
extra : moz-landing-system : lando
2018-09-17 16:54:17 +00:00
Timothy Guan-tin Chien
052ca9c390 Bug 1487143 - Properly dispatch MozAutoplayMediaBlocked event to content, r=alwu
The MozAutoplayMediaBlocked event should have its target set to the video
element, not the document.

Also, MozNoControlsBlockedVideo event has to initialized from the CustomEvent
constructor of the right window for the XBL binding to access it. I don't know
when it stopped working.

Test is added to ensure the entire UI won't break.

Differential Revision: https://phabricator.services.mozilla.com/D5801

--HG--
extra : moz-landing-system : lando
2018-09-13 21:21:11 +00:00
alwu
490f94cf41 Bug 1453862 - Log to web console when autoplay blocked. r=flod,baku
Log to the web console when we block autoplay, in order to help web developers debug their sites.

Differential Revision: https://phabricator.services.mozilla.com/D4406

--HG--
extra : moz-landing-system : lando
2018-08-29 16:51:24 +00:00
alwu
5f20aea27a Bug 1485189 - part1 : dispatch related events when play is not allowed. r=cpearce
"blocked" event is used for testing.

"MozAutoplayMediaBlocked" event is used for changing the control UI on Fennec.

Differential Revision: https://phabricator.services.mozilla.com/D4267

--HG--
extra : moz-landing-system : lando
2018-08-28 22:03:15 +00:00