Commit graph

1515 commits

Author SHA1 Message Date
Karl Tomlinson
fb0873a1d5 Bug 1832479 use types for decoder owner Invalidate() boolean parameters r=pehrsons
for safety and readability.

Differential Revision: https://phabricator.services.mozilla.com/D177983
2023-05-16 21:30:29 +00:00
Emilio Cobos Álvarez
51758cfc9b Bug 1829189 - Make OnAttrSetButNotChanged and AfterSetAttr infallible. r=smaug
Same rg + sed shenanigans as the first patch.

There were two that could fail, both due to OOM:

 * HTMLInputElement::AfterSetAttr: If we fail (only in the type=range
   case) we end up with an old value without it being clamped by
   min/max/step.

 * HTMLBodyElement::AfterSetAttr: If we fail we won't peek up the
   DocShell's frame margins and styling could be incorrect.

That seems better than having to deal with broken states after we've
already set the attribute.

Depends on D176069

Differential Revision: https://phabricator.services.mozilla.com/D176070
2023-04-21 08:56:27 +00:00
Emilio Cobos Álvarez
641fa20731 Bug 1825825 - Simplify NAC setup. r=smaug
Make all UA widgets also NAC.

Keep the UA widget flag but break at anonymous subtree boundaries, so
that only nodes inside the UA widget directly (and not NAC from those)
get the flag.

This is important because two callers depend on this difference:

 * The style system, since we still want to match content rules from
   stylesheets in the UA widget. We also match user rules, which is a
   bit sketchy, but that was the previous behavior, will file a
   follow-up for that.

 * The reflector code, since we want the scope for UA widgets to not
   include the NAC nodes inside that UA widget. nsINode::IsInUAWidget
   got it wrong.

After this patch, ChromeOnlyAccess is equivalent to
IsInNativeAnonymousSubtree, so we should probably unify the naming.
That's left for a follow-up patch because I don't have a strong
preference.

Differential Revision: https://phabricator.services.mozilla.com/D174310
2023-04-05 09:19:15 +00:00
Andreas Pehrson
6524982237 Bug 1807215 - Make the intrinsic size arg in MediaDecoderOwner::Invalidate a const ref. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D174083
2023-04-03 08:36:39 +00:00
Andi-Bogdan Postelnicu
10f49d4180 Bug 1660405 - Move away from mozilla::IsNaN in favor of std::isnan. r=nbp,media-playback-reviewers,sergesanspaille,padenot
Differential Revision: https://phabricator.services.mozilla.com/D173035
2023-03-22 11:35:33 +00:00
Stanca Serban
e31a178029 Backed out 7 changesets (bug 1660405) for causing bustages on Linux x64 opt. CLOSED TREE
Backed out changeset ad1a5f59214f (bug 1660405)
Backed out changeset a39e95f0aafe (bug 1660405)
Backed out changeset 48629ee0d70d (bug 1660405)
Backed out changeset 8419b99aab60 (bug 1660405)
Backed out changeset 535cc12c8bed (bug 1660405)
Backed out changeset e27052da4927 (bug 1660405)
Backed out changeset 11b0f9cf8091 (bug 1660405)
2023-03-22 13:05:53 +02:00
Andi-Bogdan Postelnicu
a5d28acdd6 Bug 1660405 - Move away from mozilla::IsNaN in favor of std::isnan. r=nbp,media-playback-reviewers,sergesanspaille,padenot
Differential Revision: https://phabricator.services.mozilla.com/D173035
2023-03-22 09:27:56 +00:00
alwu
772b7e4585 Bug 1820723 - do not create wakelock if XPCOM has started shutdown. r=media-playback-reviewers,jolin
Differential Revision: https://phabricator.services.mozilla.com/D172031
2023-03-09 18:08:43 +00:00
Tom Schuster
16d1d2ed89 Bug 1813584 - Use fine grained RFP for CubebUtils::PreferredSampleRate. r=media-playback-reviewers,alwu
Differential Revision: https://phabricator.services.mozilla.com/D168523
2023-02-15 10:55:31 +00:00
Paul Adenot
859e63e756 Bug 1812542 - Rename nsMediaElement and nsMediaElementEvents log modules. r=media-playback-reviewers,kinetik
Differential Revision: https://phabricator.services.mozilla.com/D167913
2023-01-27 17:10:47 +00:00
alwu
60bbc8ab3d Bug 1773551 - part1 : move AutoplayPolicy to media namespace in order to prevent naming collision. r=media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D164748
2022-12-19 20:57:54 +00:00
alwu
2a156f31ff Bug 1803834 - part2 : pause/resume non-audible autoplay video when its visibility changes. r=media-playback-reviewers,padenot
https://html.spec.whatwg.org/multipage/media.html#ready-states:eligible-for-autoplay-2

Depends on D163741

Differential Revision: https://phabricator.services.mozilla.com/D163742
2022-12-06 18:21:39 +00:00
alwu
64af530cf1 Bug 1803834 - part1 : rename mAutoplaying to 'mCanAutoplayFlag'. r=media-playback-reviewers,padenot
Our current attribute `mAutoplaying` seems be equal to the `can
autoplay flag` defined in the spec, so rename it to the spec name.

https://html.spec.whatwg.org/multipage/media.html#can-autoplay-flag

Differential Revision: https://phabricator.services.mozilla.com/D163741
2022-12-06 18:21:39 +00:00
Martin Robinson
abb5044ca7 Bug 1803377 - Rename the values of the IntrinsicDirty enum r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D163607
2022-12-02 12:27:31 +00:00
Andreas Pehrson
2ed52d6125 Bug 1796069 - Annotate MediaStreamTrackSources with a tracking id and apply it to CopyVideoStages. r=padenot
This will allow time consuming tasks (copies, capture, etc.) along the pipe to
be grouped per-track-source when visualizing profiler markers.

Differential Revision: https://phabricator.services.mozilla.com/D160754
2022-12-01 09:52:46 +00:00
Botond Ballo
68c71a503c Bug 1802225 - Remove Layers.{h,cpp}. r=tnikkel,geckoview-reviewers,jgilbert,media-playback-reviewers,padenot,m_kato
Where appropriate, `#include "Layers.h"` is replaced with
more specific inclusions.

Differential Revision: https://phabricator.services.mozilla.com/D162934
2022-11-29 01:52:03 +00:00
Karl Tomlinson
703b1dbfda Bug 1786306 merge AudioStreamTrack::SetAudioOutputDevice() into AddAudioOutput() r=padenot
The SetAudioOutputDevice() implementation required a subsequent
AddAudioOutput() call, so there is no need to have separate methods.

Differential Revision: https://phabricator.services.mozilla.com/D158310
2022-09-30 04:13:35 +00:00
Brad Werth
51de674b99 Bug 1787561 Part 2: Expose HDR telemetry to HTMLMediaElement as a Chrome property. r=alwu,emilio
This is necessary scaffolding for testing of the HDR telemetry in a way
that involves the RDD process. This is important for matching real-world
conditions.

Depends on D155902

Differential Revision: https://phabricator.services.mozilla.com/D156245
2022-09-08 18:02:04 +00:00
Kershaw Chang
d164608d66 Bug 1760580 - P2: Provide a reason when request is cancelled with NS_BINDING_ABORTED, r=necko-reviewers,media-playback-reviewers,valentin,chunmin
Differential Revision: https://phabricator.services.mozilla.com/D156071
2022-09-08 09:11:19 +00:00
criss
d87f2984cd Backed out 3 changesets (bug 1787561) for causing mochitest failures on browser_tab_visibility_and_play_time.js
Backed out changeset a41ab0c5f32f (bug 1787561)
Backed out changeset c1375f03dc75 (bug 1787561)
Backed out changeset afef5857aea6 (bug 1787561)
2022-09-07 23:49:05 +03:00
Brad Werth
99ed6acbb7 Bug 1787561 Part 2: Expose HDR telemetry to HTMLMediaElement as a Chrome property. r=alwu,emilio
This is necessary scaffolding for testing of the HDR telemetry in a way
that involves the RDD process. This is important for matching real-world
conditions.

Depends on D155902

Differential Revision: https://phabricator.services.mozilla.com/D156245
2022-09-07 18:31:46 +00:00
Emilio Cobos Álvarez
08dfe7c199 Bug 1785089 - Minor drive-by clean-ups. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D154800
2022-08-17 21:07:27 +00:00
Emilio Cobos Álvarez
060844671d Bug 1785089 - Don't spam the console and front-end with autoplay blocked events. r=alwu
Once per video should be enough.

Differential Revision: https://phabricator.services.mozilla.com/D154798
2022-08-17 21:02:44 +00:00
Chun-Min Chang
edc56a360b Bug 1776796 - Rename MarkAsContentSource r=media-playback-reviewers,alwu
`HTMLMediaElement::MarkAsContentSource` [1] was added in Bug 1299718 to
monitor the visibility / invisibility of various usage of video element.
However, that telemetry had been removed in Bug 1356046.
`MarkAsContentSource` is only used for logging currently. It's better to
reword its name and related comments to bring the code in line with the
current status.

[1] https://searchfox.org/mozilla-central/rev/5b2d2863bd315f232a3f769f76e0eb16cdca7cb0/dom/html/HTMLMediaElement.h#799

Differential Revision: https://phabricator.services.mozilla.com/D150434
2022-07-27 00:20:45 +00:00
Emilio Cobos Álvarez
255763ef57 Bug 1773070 - Unify Gecko and Servo EventState/ElementState bits. r=smaug
Add a dom/base/rust crate called just "dom" where we can share these.

Most of the changes are automatic:

  s/mozilla::EventStates/mozilla::dom::ElementState/
  s/EventStates/ElementState/
  s/NS_EVENT_STATE_/ElementState::/
  s/NS_DOCUMENT_STATE_/DocumentState::/

And so on. This requires a new cbindgen version to avoid ugly casts for
large shifts.

Differential Revision: https://phabricator.services.mozilla.com/D148537
2022-06-07 23:09:52 +00:00
june wilde
29fb0fb057 Bug 1731614 - Clarify error phrasing in NoSupportedMediaSourceError; r=ckerschb,dveditz
Differential Revision: https://phabricator.services.mozilla.com/D145576
2022-05-23 21:27:48 +00:00
Kagami Sascha Rosylight
b1653a09c7 Bug 1767996 - Apply readability-make-member-function-const on dom/html r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D145627
2022-05-13 05:35:25 +00:00
az
2607db324d Bug 1652950 - Unprefix mozPreservesPitch, update corresponding tests r=emilio,saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D143237
2022-04-20 18:43:47 +00:00
ashley
bbae966812 Bug 1744398 - Media element load algorithm must fire 'emptied' before 'timeupdate' r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D142628
2022-04-01 18:26:05 +00:00
Bryce Seager van Dyk
ff03cc04a5 Bug 1724106 - Clarify threading usage when getting media debug info. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D124104
2022-03-29 22:17:58 +00:00
Paul Adenot
7506e056c3 Bug 1272636 - Reset HTMLMediaElement.played when loading a new source. r=media-playback-reviewers,alwu
Differential Revision: https://phabricator.services.mozilla.com/D139925
2022-03-08 13:05:28 +00:00
Paul Adenot
b980ff2250 Bug 1630569 - Change the limit at which audio is muted with high or low playback rates, and make it and other parameters configurable via prefs. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D135066
2022-01-05 18:11:58 +00:00
Masayuki Nakano
4341d6fb0c Bug 1455514 - part 1: Add accessors and static helper methods to retrieve nsINode or its concrete classes from EventTarget r=smaug
Currently, checking whether an `EventTarget` is `nsINode` (or its concrete
classes) or not requires a QI, but it's expensive and used a lot while we
handle each event.  Therefore, it'd be nicer for creating a virtual method,
`EventTarget::IsNode()` and use it for the check.

If trying to convert `EventTarget` to a concrete class, it may require two
virtual method calls.  I'm not sure whether it's cheaper than a QI, but at
least, it won't depend on the UUID check order of `QueryInterface()` when
multiple interfaces are implemented.

Differential Revision: https://phabricator.services.mozilla.com/D129781
2021-11-02 13:03:43 +00:00
Jeff Muizelaar
cde3f4b00b Bug 1736077 - Remove unusued LayerManager.cpp. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D128632
2021-10-17 01:28:41 +00:00
Paul Adenot
5f6c907318 Bug 1678373 - Add a way to measure the duration a media was muted. r=alwu,webidl,emilio
Differential Revision: https://phabricator.services.mozilla.com/D125088
2021-10-12 09:03:53 +00:00
Paul Adenot
2a5cb9f5c5 Bug 1678373 - Expose audio telemetry counters as chrome-only attributes like their video counterparts. r=alwu,webidl,emilio
Differential Revision: https://phabricator.services.mozilla.com/D125084
2021-10-12 09:03:52 +00:00
Paul Adenot
1a85208ad7 Bug 1678373 - Rename chrome-only telemetry counter attributes to distinguish audio and video. r=alwu,webidl,emilio
Differential Revision: https://phabricator.services.mozilla.com/D125083
2021-10-12 09:03:52 +00:00
Alexandru Michis
26c14b3225 Backed out 24 changesets (bug 1678373) for causing bc failures in browser_tab_visibility_and_play_time.js
CLOSED TREE

Backed out changeset 1886dbd81c46 (bug 1678373)
Backed out changeset aeff26b5b1ae (bug 1678373)
Backed out changeset 261d8e4483d4 (bug 1678373)
Backed out changeset 89cb5ae23632 (bug 1678373)
Backed out changeset b1eaedd192ab (bug 1678373)
Backed out changeset 58a3eb19c818 (bug 1678373)
Backed out changeset b027ec789cbe (bug 1678373)
Backed out changeset fd596a84feb9 (bug 1678373)
Backed out changeset 1f0ed0392ae2 (bug 1678373)
Backed out changeset ac2be1df81af (bug 1678373)
Backed out changeset bf6d47905d78 (bug 1678373)
Backed out changeset a9fe4f310962 (bug 1678373)
Backed out changeset a15316058968 (bug 1678373)
Backed out changeset 217cdfd46120 (bug 1678373)
Backed out changeset c33c8411129b (bug 1678373)
Backed out changeset 3b854fc36abf (bug 1678373)
Backed out changeset e47c82bcb49a (bug 1678373)
Backed out changeset 2a77cbba1c9f (bug 1678373)
Backed out changeset 65206afede36 (bug 1678373)
Backed out changeset bd04930155f4 (bug 1678373)
Backed out changeset 034e8edd4619 (bug 1678373)
Backed out changeset ed1e56487c4c (bug 1678373)
Backed out changeset b7673d20c521 (bug 1678373)
Backed out changeset 5a93251e2fea (bug 1678373)
2021-10-07 20:36:47 +03:00
Paul Adenot
82125c0639 Bug 1678373 - Add a way to measure the duration a media was muted. r=alwu,webidl,emilio
Differential Revision: https://phabricator.services.mozilla.com/D125088
2021-10-07 15:44:54 +00:00
Paul Adenot
6dc847cdf6 Bug 1678373 - Expose audio telemetry counters as chrome-only attributes like their video counterparts. r=alwu,webidl,emilio
Differential Revision: https://phabricator.services.mozilla.com/D125084
2021-10-07 15:44:53 +00:00
Paul Adenot
94b7678216 Bug 1678373 - Rename chrome-only telemetry counter attributes to distinguish audio and video. r=alwu,webidl,emilio
Differential Revision: https://phabricator.services.mozilla.com/D125083
2021-10-07 15:44:53 +00:00
Paul Adenot
2d55780bdd Bug 1733109 - function 'mozilla::dom::HTMLMediaElement::MozGetMetadata' has a definition with different parameter names in HTMLMediaElement.cpp. r=alwu
Depends on D126946

Differential Revision: https://phabricator.services.mozilla.com/D126947
2021-09-30 12:36:18 +00:00
Paul Adenot
477acd5f27 Bug 1733109 - narrowing conversion from 'double' to 'float' in HTMLMediaElement.cpp. r=alwu
Depends on D126945

Differential Revision: https://phabricator.services.mozilla.com/D126946
2021-09-30 12:36:18 +00:00
Paul Adenot
f3cd1e466b Bug 1733109 - 'auto cdmProxy' can be declared as 'auto *cdmProxy' in HTMLMediaElement.cpp. r=alwu
Depends on D126944

Differential Revision: https://phabricator.services.mozilla.com/D126945
2021-09-30 12:36:18 +00:00
Paul Adenot
97fe06afcc Bug 1733109 - do not use 'else' after 'return' in HTMLMediaElement.cpp. r=alwu
Depends on D126943

Differential Revision: https://phabricator.services.mozilla.com/D126944
2021-09-30 12:36:17 +00:00
Paul Adenot
915a3a4d1a Bug 1733109 - local copy 'handle' of the variable 'aPrincipalHandle' is never modified; consider avoiding the copy in HTMLMediaElement.cpp. r=alwu
Depends on D126942

Differential Revision: https://phabricator.services.mozilla.com/D126943
2021-09-30 12:36:17 +00:00
Paul Adenot
0f7d0e3beb Bug 1733109 - 'auto decoder' can be declared as 'auto *decoder' in HTMLMediaElement.cpp. r=alwu
Depends on D126941

Differential Revision: https://phabricator.services.mozilla.com/D126942
2021-09-30 12:36:16 +00:00
Paul Adenot
ab7bfb48a1 Bug 1733109 - 'auto decoder' can be declared as 'auto *decoder' in HTMLMediaElement.cpp. r=alwu
Depends on D126940

Differential Revision: https://phabricator.services.mozilla.com/D126941
2021-09-30 12:36:16 +00:00
Paul Adenot
4ef93dfafd Bug 1733109 - move constructors should be marked noexcept HTMLMediaElement.cpp. r=alwu
We don't use exceptions anyways, but having no warnings allows warning us when
warnings appear, so let's fix this.

Depends on D126939

Differential Revision: https://phabricator.services.mozilla.com/D126940
2021-09-30 12:36:16 +00:00
Paul Adenot
7b15802441 Bug 1733109 - narrowing conversion from 'unsigned long' to signed type 'int32_t' (aka 'int') is implementation-defined HTMLMediaElement.cpp. r=pehrsons
Somewhat controversial, let me know what you think.

Differential Revision: https://phabricator.services.mozilla.com/D126939
2021-09-30 12:36:15 +00:00
Paul Adenot
eb06a61abe Bug 1733109 - redundant return statement at the end of a function with a void return type in HTMLMediaElement.cpp. r=alwu
Depends on D126937

Differential Revision: https://phabricator.services.mozilla.com/D126938
2021-09-30 12:36:15 +00:00
Paul Adenot
91a3981b9c Bug 1733109 - narrowing conversion from 'double' to 'float' in HTMLMEdiaElement.cpp. r=alwu
Depends on D126935

Differential Revision: https://phabricator.services.mozilla.com/D126936
2021-09-30 12:36:14 +00:00
Paul Adenot
b9d6ecd246 Bug 1733109 - constructor does not initialize these fields: mOwnerBrowsingContextId in HTMLMEdiaElement.cpp. r=alwu
Depends on D126934

Differential Revision: https://phabricator.services.mozilla.com/D126935
2021-09-30 12:36:14 +00:00
Olli Pettay
f083f381d8 Bug 1727514 - media playback should stop in the bfcache, r=peterv
This version doesn't change SetContainer handling, since it seems to be tricky for the top level page.
So only activity change notification is fired and IsActive() is updated.
The comment about IsActive() was wrong even with the old bfcache implementation.
(I did check that it returned false when the page was in bfcache and many of the activity observers rely on that)

The changes to HTMLMediaElement are needed to ensure page can enter bfcache..

Differential Revision: https://phabricator.services.mozilla.com/D124684
2021-09-20 08:49:22 +00:00
Sandor Molnar
c60bc752d8 Backed out changeset 2d49d73f38aa (bug 1727514) for causing frequent crashes. a=backout 2021-09-16 15:52:56 +03:00
Olli Pettay
d0485c8a55 Bug 1727514 - media playback should stop in the bfcache, r=peterv
SetContainer handling is similar to what DocumentViewer does for the old bfcache implementation.
(The old implementation hides it quite well).
The changes to HTMLMediaElement are needed to ensure page can enter bfcache.

Removed erroneous MOZ_ASSERT in nsPresContext, it is ok to trigger that code path in the new implementation.
And the Run() method of the relevant nsIRunnable already deals with that case.

Differential Revision: https://phabricator.services.mozilla.com/D124684
2021-09-13 12:40:18 +00:00
Alexandru Michis
bd2de15f47 Backed out 2 changesets (bug 1724106) for causing Bug 1728715.
CLOSED TREE

Backed out changeset 81d1db229eea (bug 1724106)
Backed out changeset 8ed4675541c6 (bug 1724106)
2021-09-02 21:03:07 +03:00
Bryce Seager van Dyk
cfec4e7dfa Bug 1724106 - Clarify threading usage when getting media debug info. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D124104
2021-09-01 22:29:48 +00:00
alwu
01fee60b95 Bug 1723799 - part2 : add test. r=padenot,webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D121681
2021-08-09 19:30:12 +00:00
Kagami Sascha Rosylight
c69d367ce0 Bug 1723050 - Part 14: Replace typedef by using in dom/html/ r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D121312
2021-08-09 13:37:27 +00:00
Karl Tomlinson
50445cc8e2 Bug 1577199 apply speaker-selection feature policy r=jib
Differential Revision: https://phabricator.services.mozilla.com/D119867
2021-08-02 00:13:57 +00:00
Tooru Fujisawa
cc92ef732d Bug 1708448 - Move property and element functions into js/public/PropertyAndElement.h. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D119619
2021-07-13 11:52:42 +00:00
Karl Tomlinson
ebbb65d72e Bug 1493982 accept only sinkIds exposed via enumerateDevices() r=jib
and reject with NotFoundError otherwise.

Depends on D118444

Differential Revision: https://phabricator.services.mozilla.com/D118445
2021-07-06 23:37:33 +00:00
Karl Tomlinson
832509f1a5 Bug 1493982 move GetSinkDevice() to MediaDevices for access to device exposure history r=jib
Depends on D118443

Differential Revision: https://phabricator.services.mozilla.com/D118444
2021-07-06 23:37:32 +00:00
Paul Adenot
78824dbdc4 Bug 1703603 - Handle HTMLMediaElement playing MediaSource when using mozCaptureStreamUntilEnded. r=bryce
This means keeping a reference to the MediaSource object in the MediaStream to
ensure it's being kept alive for the duration of the playback.

Differential Revision: https://phabricator.services.mozilla.com/D112607
2021-06-02 14:20:40 +00:00
Olli Pettay
b01c8b4aff Bug 1705080, make MediaStreams behave as normal EventTargets, r=jib
Differential Revision: https://phabricator.services.mozilla.com/D115269
2021-05-18 16:21:27 +00:00
Csoregi Natalia
d1bbd6e368 Backed out 2 changesets (bug 1693250) for failures on test_recreate_media_sink_audible_change.html. CLOSED TREE
Backed out changeset 0e0f90271853 (bug 1693250)
Backed out changeset 45cd86944c9f (bug 1693250)
2021-05-06 01:14:51 +03:00
alwu
429bd59056 Bug 1693250 - part2 : reset the audible state when the audio sink get shutdown. r=bryce
When the audio sink shutdown, we should also reset the audible state for the listeners. Otherwise, MediaDecoderStateMachine would possibly rely on the incorrect audible state that is produced by previous sink, which would cause showing the sound indicator even if no sound is being playing.

Eg.
Considering following case without the reset of the audible state
1. Sink A is audible -> MDSM set `mIsAudioDataAudible=true`
2. Stop sink
3. Recreate sink B and it's playing silence -> MDSM's `mIsAudioDataAudible=true` is still true, this is wrong!

Differential Revision: https://phabricator.services.mozilla.com/D113550
2021-05-05 20:07:07 +00:00
alwu
ebd128cde0 Bug 1689741 - not controlling the real-time media via the media control. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D112668
2021-04-20 16:47:41 +00:00
Brendan Early
11d4046786 Bug 1120222 - Set AudioSink name to title of MediaElement's parent r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D93462
2021-04-19 15:17:26 +00:00
Peter Van der Beken
164f59d833 Bug 1696158 - Move CanSavePresentation to the parent process. Keep track of various flags for deciding whether to put a page in BFCache. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D110231
2021-04-19 14:50:54 +00:00
smolnar
84a0543987 Backed out 8 changesets (bug 1696158) for causing multiple failures. CLOSED TREE
Backed out changeset 09c598c8fd29 (bug 1696158)
Backed out changeset 02f956c26901 (bug 1696158)
Backed out changeset b61a3a324cce (bug 1696158)
Backed out changeset 95810ed7f1e5 (bug 1696158)
Backed out changeset 4f93a7b61496 (bug 1696158)
Backed out changeset c80c55b56f2a (bug 1696158)
Backed out changeset 11627c409882 (bug 1696158)
Backed out changeset b98b4316a510 (bug 1696158)
2021-04-19 17:04:08 +03:00
Peter Van der Beken
a1306f8324 Bug 1696158 - Move CanSavePresentation to the parent process. Keep track of various flags for deciding whether to put a page in BFCache. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D110231
2021-04-19 12:39:19 +00:00
Paul Adenot
8d2ea44b0e Bug 1701276 - Adjust currentSrc behaviour to match the spec more closely. r=bryce
Firefox and Chrome support setting `src` with an `ObjectURL`. This is
technically a URL and should be treated as such. Firefox recently changed to
return `""` when a `MediaSource` is playing, and this is wrong, because even
though it's playing a from a "Media Provider Object", it got loaded from the
`src` attribute, so should have a non-null `currentSrc`, which should be the
blob url (`blob:origin/<an uuid>`). In this case, `currentSrc` is a string that
is opaque and doesn't allow introspection but refers to the "real" `MediaSource`
or `Blob`.

If the same `MediaSource` is loaded via the `srcObject` attribute (that Firefox
and Chrome don't support), then `currentSrc` should return `""` and `srcObject`
still has the object set to it to understand what the HTMLMediaElement is
playing. We'll implement and test this later.

Differential Revision: https://phabricator.services.mozilla.com/D110290
2021-04-01 12:28:50 +00:00
Csoregi Natalia
e99de2637f Backed out changeset fe753b00f953 (bug 1701276) for wpt fails on resource-selection-currentSrc.html. CLOSED TREE 2021-03-31 21:00:20 +03:00
Paul Adenot
3a84032713 Bug 1701276 - Adjust currentSrc behaviour to match the spec more closely. r=bryce
Firefox and Chrome support setting `src` with an `ObjectURL`. This is
technically a URL and should be treated as such. Firefox recently changed to
return `""` when a `MediaSource` is playing, and this is wrong, because even
though it's playing a from a "Media Provider Object", it got loaded from the
`src` attribute, so should have a non-null `currentSrc`, which should be the
blob url (`blob:origin/<an uuid>`). In this case, `currentSrc` is a string that
is opaque and doesn't allow introspection but refers to the "real" `MediaSource`
or `Blob`.

If the same `MediaSource` is loaded via the `srcObject` attribute (that Firefox
and Chrome don't support), then `currentSrc` should return `""` and `srcObject`
still has the object set to it to understand what the HTMLMediaElement is
playing. We'll implement and test this later.

Differential Revision: https://phabricator.services.mozilla.com/D110290
2021-03-31 12:28:39 +00:00
Eden Chuang
c7aa9a7c9c Bug 1696111 - Make LoadInfo know if the request is triggered from a media element and if it's an initial request. r=necko-reviewers,alwu,dragana
Differential Revision: https://phabricator.services.mozilla.com/D106890
2021-03-30 00:52:31 +00:00
Butkovits Atila
ad9b1ed9d7 Backed out 12 changesets (bug 1683131, bug 1696111, bug 1695987) for causing crashes(Bug 1701151). a=backout
Backed out changeset 8ffef57e27d2 (bug 1683131)
Backed out changeset c02d5dc72abb (bug 1695987)
Backed out changeset 276f016ddc67 (bug 1683131)
Backed out changeset 2c7a45e20b50 (bug 1683131)
Backed out changeset 11fdb503d537 (bug 1696111)
Backed out changeset 2946eff1e9c8 (bug 1696111)
Backed out changeset e4d01b88e517 (bug 1696111)
Backed out changeset fab7f4cd445d (bug 1696111)
Backed out changeset d60c38f8939a (bug 1696111)
Backed out changeset 3fdc8089a46f (bug 1696111)
Backed out changeset 51a16dfabc98 (bug 1696111)
Backed out changeset 642bdd52fd57 (bug 1696111)
2021-03-26 11:30:28 +02:00
Eden Chuang
908b174731 Bug 1696111 - Make LoadInfo know if the request is triggered from a media element and if it's an initial request. r=necko-reviewers,alwu,dragana
Differential Revision: https://phabricator.services.mozilla.com/D106890
2021-03-25 12:09:40 +00:00
Simon Giesecke
cc730d05dd Bug 1184468 - Use nsTHashtable::Keys where possible. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D108588
2021-03-24 17:56:50 +00:00
Simon Giesecke
613e20d136 Bug 1184468 - Use nsBaseHashtable::Values. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D108587
2021-03-24 17:56:49 +00:00
Simon Giesecke
b9621d6376 Bug 1695162 - Use range-based for instead of custom hashtable iterators. r=xpcom-reviewers,kmag
Differential Revision: https://phabricator.services.mozilla.com/D108585
2021-03-17 15:49:46 +00:00
Simon Giesecke
cb6c8aead4 Bug 1695162 - Make nsTHashtable::ConstIter return a real ConstIterator. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D107038
2021-03-09 10:28:16 +00:00
Sylvestre Ledru
4edd85cc9b Bug 1519636 - Reformat recent changes to the Google coding style r=necko-reviewers,valentin
Updated with clang-format version 11.0.1 (taskcluster-B6bdwSKDRF-luRQWXBuzpA)

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D106920
2021-03-02 16:14:46 +00:00
Simon Giesecke
2586ff14b9 Bug 1693541 - Improve uses of nsBaseHashtable and descendants and avoid multiple subsequent lookups in dom/html. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D106112
2021-03-01 09:59:29 +00:00
Simon Giesecke
9af107a839 Bug 1691913 - Rename nsBaseHashtable::Put to InsertOrUpdate. r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
This makes the naming more consistent with other functions called
Insert and/or Update. Also, it removes the ambiguity whether
Put expects that an entry already exists or not, in particular because
it differed from nsTHashtable::PutEntry in that regard.

Differential Revision: https://phabricator.services.mozilla.com/D105473
2021-02-26 09:11:46 +00:00
alwu
02a5936205 Bug 1691578 - part7 : add test case for audio sink failed start-up. r=bryce,emilio
Differential Revision: https://phabricator.services.mozilla.com/D104571
2021-02-25 18:07:07 +00:00
alwu
23f1c32275 Bug 1691578 - part6 : add test cases to test reporting decode error. r=bryce,webidl,emilio
Differential Revision: https://phabricator.services.mozilla.com/D104570
2021-02-25 18:07:06 +00:00
alwu
ee8e5fb47f Bug 1691578 - part5 : add test cases to test the ability of reporting error for not supported media type. r=bryce,emilio
Add test cases for `DecoderDoctorDiagnostics::StoreFormatDiagnostics()`, which is used when checking the ability of whether the decoder is supported for certain type.

Differential Revision: https://phabricator.services.mozilla.com/D104475
2021-02-25 18:07:06 +00:00
Cosmin Sabou
424d49d43e Backed out 8 changesets (bug 1691578) for bc failures on browser_decoderDoctor.js. CLOSED TREE
Backed out changeset c535dd429ada (bug 1691578)
Backed out changeset 518eadda7826 (bug 1691578)
Backed out changeset c181e29b13f2 (bug 1691578)
Backed out changeset 23f6dcc3ceb5 (bug 1691578)
Backed out changeset bfd3e4878545 (bug 1691578)
Backed out changeset 214ab3a2f00b (bug 1691578)
Backed out changeset 71a17ff3322c (bug 1691578)
Backed out changeset 6aa662e8d06e (bug 1691578)
2021-02-25 21:08:07 +02:00
alwu
3b9b787bdf Bug 1691578 - part7 : add test case for audio sink failed start-up. r=bryce,emilio
Differential Revision: https://phabricator.services.mozilla.com/D104571
2021-02-25 18:07:07 +00:00
alwu
5c51ce0bba Bug 1691578 - part6 : add test cases to test reporting decode error. r=bryce,webidl,emilio
Differential Revision: https://phabricator.services.mozilla.com/D104570
2021-02-25 18:07:06 +00:00
alwu
edf054e11a Bug 1691578 - part5 : add test cases to test the ability of reporting error for not supported media type. r=bryce,emilio
Add test cases for `DecoderDoctorDiagnostics::StoreFormatDiagnostics()`, which is used when checking the ability of whether the decoder is supported for certain type.

Differential Revision: https://phabricator.services.mozilla.com/D104475
2021-02-25 18:07:06 +00:00
Paul Adenot
5852688096 Bug 1686914 - Don't reset currentSrc when aborting a load in HTMLMediaElement, and reset it when it should be reset. r=bryce
Roughly:
- Don't reset on load
- Don't reset on URL parsing error
- Reset when playing a MediaStream, a MediaSource
- Otherwise follow the resource selection algorithm, and set it to what has been selected

Differential Revision: https://phabricator.services.mozilla.com/D101937
2021-02-16 12:39:34 +00:00
alwu
b248bcd4ac Bug 1686696 - part5 : remove nsSyncSection. r=bryce
`nsSyncSection` is not related with media event, so that's not proper ot put it in `MediaElementEventRunners.h`.

In addition, that can simply be implemented by `NS_NewRunnableFunction` so we don't need `nsSyncSection` anymore.

Differential Revision: https://phabricator.services.mozilla.com/D104115
2021-02-11 20:19:25 +00:00
alwu
30709122e3 Bug 1686696 - part3 : enforce to only dispatch periodic timeupdate once within 250ms. r=bryce
Inplemented an event runner for `timeupdate` only, which would ensure that for periodic `timeupdate` it should be only dispatched once within 250ms.

Differential Revision: https://phabricator.services.mozilla.com/D102675
2021-02-11 20:19:24 +00:00
alwu
777cb1ae03 Bug 1686696 - part2 : rework how does decoder handle owner's events when the logical position changes. r=bryce
Decoder needs to handle owner's events differently based on different situations, this patch makes the process clearer.

Differential Revision: https://phabricator.services.mozilla.com/D102674
2021-02-11 20:19:24 +00:00
alwu
976a59a484 Bug 1686696 - part1 : store pending event runner instead of saving event name. r=bryce,mccr8
In this patch, we move all event runners to a separate file and implement an event blocker.

In order to allow us to do a special check for `timeupdate` event, we have to know that event is periodic or mandatory.

We have to save extra information for `timeupdate, however, current design for storing pending events is not flexible enough to achieve that.

Therefore, instead of storing the event name, we store the event runners which can all have different implementation and know when they should dispatch their own event.

Differential Revision: https://phabricator.services.mozilla.com/D102673
2021-02-11 20:19:23 +00:00
Bogdan Tara
36a86026a3 Backed out 6 changesets (bug 1686696) for 1587248.html crashtest failures CLOSED TREE
Backed out changeset 690c6a094f8a (bug 1686696)
Backed out changeset 7f9d487945c3 (bug 1686696)
Backed out changeset 40358a758624 (bug 1686696)
Backed out changeset 36c696166033 (bug 1686696)
Backed out changeset ab149e8fc0d5 (bug 1686696)
Backed out changeset 8fce79f9bd65 (bug 1686696)
2021-02-11 06:29:47 +02:00
alwu
40fdde1bab Bug 1686696 - part5 : remove nsSyncSection. r=bryce
`nsSyncSection` is not related with media event, so that's not proper ot put it in `MediaElementEventRunners.h`.

In addition, that can simply be implemented by `NS_NewRunnableFunction` so we don't need `nsSyncSection` anymore.

Differential Revision: https://phabricator.services.mozilla.com/D104115
2021-02-11 03:45:30 +00:00