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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
`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
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
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
`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