This patch implements:
. noModule getter/setter for HTMLScriptElement
. the nomodule attribute for HTMLScriptElement
. and the logic in nsScriptLoader that denies the loading of a nomodule script
. with tests
Since NotifyCurrentTopLevelOuterContentWindowId message has high priority and could jump ahead of PNecko constructor message, we have to also give high priority to PNecko.
In our current setup, in which links with an href attribute always match either
:link or :visited, no matter whether that attribute's value is a valid URI,
changes to the attribute always put the element into either the "match nothing"
state or the "match :link" state, via calls to Link::ResetLinkState.
The only thing FlushPendingLinkUpdates is needed for is (lazily, in case it
turns out to not be needed because the element got removed from the DOM anyway)
registering a history observer to switch the link state to :visited as needed.
This means that selector matching consumers that would never expose :visited
state to start with don't need to worry about calling FlushPendingLinkUpdates.
The declarations of their refcounting methods already includes an owning
thread, so let's just piggyback on top of that to assert their owning
thread, rather than having separate fields and tests.
IMEStateManager should cache nsIWidget for sPresContext at caching sPresContext. Then, even if sPresContext has gone, IMEStateManager can clean up with the nsIWidget cache.
Unfortunately, editor has some bugs about calling IMEStateManager::UpdateIMEState(). That is, calling it *before* IMEStateManager::OnFocusChange(). In such case, this patch makes UpdateIMEState() ignore the call.
MozReview-Commit-ID: 1cydI03WyB8
Use the new helper functions instead of calling libvpx directly.
This simplifies adding other codecs in the future.
MozReview-Commit-ID: 8VX0d5S50EE
--HG--
extra : rebase_source : 34be2118bc5d1bfcb6237d7fbe67d8fbc5ef1508
Encapsulate code from WebMDemuxer to query keyframe and frame
resolution inside VPXDecoder, so we have a clean wrapper for
all the libvpx functions we use.
MozReview-Commit-ID: ASRRhNl0A41
--HG--
extra : rebase_source : e0a27e946a60e0c33ecf4908f1e09436f836e123
Use the enum we already have here instead of converting
to an int when we pass it around, giving us better
type checking.
MozReview-Commit-ID: Gj4xmtQnzw2
--HG--
extra : rebase_source : fc7769c9650c59f52bfd8611e6cabb8e5b6d7068
This simplifies the comparison and update logic.
MozReview-Commit-ID: A6YII8tlEUn
--HG--
extra : rebase_source : e225b34f91e12591d5872121e024ef29c63a11e0
Continue to allow non-multiprocessCompatible extensions in automation.
There are a ton of places that would need to be changed, many of which
will be changing soon anyway with the non-webextensions change in 57
so this is mostly the expedient route to keeping the tree green.
MozReview-Commit-ID: EZZoDVdhLfy
--HG--
extra : rebase_source : f83472bc1c88dd0deadbe485d9002499027ff07f
Since we now want to support APZ for remote frameloaders in popups, but do not
want to needlessly enable it in simple popup widgets which should never host
remote content, we need to prevent remote content from being loaded into those
popups.
MozReview-Commit-ID: WfjMC2p2eK
--HG--
extra : rebase_source : 51704fa761053e947a2c56706627c8ae903790ee
extra : histedit_source : 463b2c88c28476a824bc2951e0731453016aaa2b
Currently, we only correctly support remote layer trees for frameloaders that
use the same layer manager as their document. Since we need to be able to host
remote <browser> content in popup widgets for remote WebExtensions, we need to
tie the frameloaders to the layer manager of their host element, rather than
the root layer manager for the document.
MozReview-Commit-ID: 4RCsamFBiQw
--HG--
extra : rebase_source : 86bca4ae1c012ff1bb84a9ad796be311cfe580f6
extra : histedit_source : 19577d69430adc8cb38c195f13db2c6de6605c4c
Measure execution time by adding telemetry probes for tracking
foreground, tracking background, non-tracking foreground and
non-tracking background timeouts.
--HG--
extra : source : 69439c0cd3e6d118681d1bb6586cb0a7b4bb85fc
To mitigate the delay that a new content process startup might cause, when the
browser reaches a non-busy state we attempt to prelaunch an empty content process
in the background that can be grabbed and used the next time we need one. This patch
enables the preallocated process manager by default and attempts to fix all the
issues that prevented us doing this sooner.
The container of a radio group is the form, if it belongs to a form, or the
document object otherwise.
When moving a radio out of a form, we should add it back to a radio group.
Similary, before moving the radio to a form, we should remove it from the
original radio group.
MozReview-Commit-ID: 22WsEhz2SXH
--HG--
extra : rebase_source : 68dbd50da523b734086d8e5de6e6ae179b0b4af0
By passing the startTime as a TimeDuration we are able to represent times in the
distant past (and with the same range as we can represent on the main thread so
that if we do encounter range errors in future, they should not differ between
the main thread and the compositor).
This patch includes a crashtest. I have verified that, without the code changes
included in this patch, this crashtest fails on debug builds on OSX.
MozReview-Commit-ID: EDuKLzfEC0K
--HG--
extra : rebase_source : 1883080fdfac8c33f70698145f21e67cbdfdd4f2
In bug 1223658 we separated out the delay from the start time but we failed to
remove it from this calculation. As a result, when a pending animation begins it
will have the delay applied twice (once here, and once when it is sampled on the
compositor). This will happen until the layer is next updated.
This bug was not exposed by any existing tests since we don't use this code path
when the refresh driver is under test control. Furthermore, the one test that
was supposed to cover this was refactored in such a way that it stopped testing
this code path. That test is restored earlier in this patch series and enabled
in this patch.
MozReview-Commit-ID: B2KR7YaPsMK
--HG--
extra : rebase_source : 6c888252813fbfc01baf5d4bb1728d989ee1586c
Once upon a time[1] a test was added to test_deferred_start.html to test the
code path where we establish the start time to pass to the compositor when
resolving a pending animation.
Later[2], however, we encountered intermittent failures on B2G so we made it
stop waiting on animation.ready and use waitForPaints instead. There were two
problems with this, however.
Firstly, waiting for paints often means that extra paints are processed such
that we end up updating the start time on the layer using a different code path
and masking any potential bugs in the code path under test.
Secondly, when we made this change we replaced:
return animation.ready.then(function() { /* test code */ })
with:
return waitForPaints(function() { /* test code */ })
And sadly that means that 'test code' never runs. Of course, what we meant to
write was:
return waitForPaints().then(function() { /* test code */ })
As a result, when we later broke the code path under test no one noticed.
This patch restores the test so that it tests what it intends to (and currently
fails, at least most of the time).
[1] https://hg.mozilla.org/mozilla-central/rev/79cac8c71159
[2] https://hg.mozilla.org/mozilla-central/rev/986b18fdfdba
[3] https://hg.mozilla.org/mozilla-central/rev/b66b75c2d042101b954e6423438cc07955c2b9bd
MozReview-Commit-ID: 1iMWLQP6zae
--HG--
extra : rebase_source : 2766f25b150af3e98afc6214f59a329798961943
We need to use this API in the front-end code, and in the off-chance
that we end up turning it off for the Web for whatever reason, or if
someone has turned off the pref, we should make sure our UI code does
not break.
Measure execution time by adding telemetry probes for tracking
foreground, tracking background, non-tracking foreground and
non-tracking background timeouts.
--HG--
extra : rebase_source : f638cc4422a777bbd093d5bbb2d5852c19b1c9d1
Preliminary telemetry indicated 15% of users of EME are in an insecure
context. We'd better log a warning to the web console to inform authors
that their sites will stop working, rather than just breaking them!
MozReview-Commit-ID: CZasdbcC1jS
--HG--
extra : rebase_source : 008b9669d06a77bb133459df6479625ed47249a0
Try to speed up perceived pageload by opening a connection as soon as the
user mouses down on a link, instead of waiting for the full click/AsyncOpen
process to get there.
MozReview-Commit-ID: 4g6mZXWt9H5
--HG--
extra : rebase_source : cf7b5628058c1a1bcadc8531f2da44d259c6fdaa
Continue to allow non-multiprocessCompatible extensions in automation.
There are a ton of places that would need to be changed, many of which
will be changing soon anyway with the non-webextensions change in 57
so this is mostly the expedient route to keeping the tree green.
MozReview-Commit-ID: EZZoDVdhLfy
--HG--
extra : rebase_source : 34aa762917566b052ade6372280caed72fbfbe9a
Preliminary telemetry indicated 15% of users of EME are in an insecure
context. We'd better log a warning to the web console to inform authors
that their sites will stop working, rather than just breaking them!
MozReview-Commit-ID: CZasdbcC1jS
--HG--
extra : rebase_source : 685a36be1601215aff4e962fd206d1332abbff79
Otherwise we end up calling into editor code and doing a bunch of work even though the value hasn't actually changed, when a value with \r in it is set repeatedly.
For some reason, when running test_presentation_sender_startWithDevice.html
we end up running mockedSessionTransport.close() late in shutdown. The
special powers code to do sendAsyncMessage has been torn down already,
and we end up leaking in shutdown, without an extra GC.
Also, this patch replaces some leading tabs with spaces.
MozReview-Commit-ID: BnwMBgR8iYZ
--HG--
extra : rebase_source : 42073b9da0053083f39704724d6282c60c116484
We can early return to call MayHaveAnimations() (and it should be fast) since
we set the flag in EffectSet::GetOrCreateEffectSet(),
MozReview-Commit-ID: 2UfWVVi6nY5
--HG--
extra : rebase_source : 97e98bf1fb9e725a107ed3200b95921375bfb637
PLayerTransaction's constructor was previously synchronous so we could
return a TextureFactoryIdentifier. This is quite reliably available
already in the case of opening a tab, due to RenderFrameParent knowing
which compositor it is attached to, so we can make the constructor
asynchronous.
In the top-level widget case, we add a new synchronous message to find
the TextureFactoryIdentifier.
This is a re-land of 9900d421e24e, which was backed out.
r=qdot,haik
MozReview-Commit-ID: FjugGCVWS8T
--HG--
extra : rebase_source : 7913a74a7bac9df09f8fc8e923384b5ac2569400
Because ProfilerMarkerPayload is the main type defined in these files, and
because the next patch is going to introduce ProfilerMarker.{h,cpp}, which
would be confusingly similar to the old names.
--HG--
rename : tools/profiler/core/ProfilerMarkers.cpp => tools/profiler/core/ProfilerMarkerPayload.cpp
rename : tools/profiler/public/ProfilerMarkers.h => tools/profiler/public/ProfilerMarkerPayload.h
extra : rebase_source : df22a2ab3867650348ae78fe959ff0366aff230b
When firing an event, check if there is any event in the delayed events queue,
if yes, fire them first to ensure the events are fired in the right order.
MozReview-Commit-ID: DY842oiHcVJ
The simulcast mochitests setup the receiving PeerConnection to receive
simulcast video streams which Firefox doesn't really support. Without
a test media server, this is about the best we can do and still test
simulcast.
Unfortunately the two simulcast streams arriving with different ssrcs
(as expect) exercises code we have to deal with some services switching
ssrcs midstream. In the tests, this causes intermittent failures
because the test is waiting to receive a certain ssrc, and the receiving
VideoConduit has switched to the other ssrc.
This change adds the ability to filter on RID at the MediaPipeline level,
which we can setup prior to media flowing. This avoids the ssrc switching
issue since the VideoConduit only receives one ssrc until we change the
RID filter to the second RID. At that point, the VideoConduit sees a new
ssrc and the switching code works as intended.
The modified mochitests setup the RTP stream id header extension, and then
filter on each of the RTP stream ids in turn.
MozReview-Commit-ID: KApfaxMX8rl
--HG--
extra : rebase_source : d7ae88d9675acd7b3700f342ca6a68d0bbb0ced5
The simulcast mochitests exhibit an intermittent failure due to ssrc-based
filtering that can be solved by filtering by RID. The RTP header parser
used in MediaPipeline also needs to have the RID RTP header extension
specified in order for it to properly parse the RTP header and allow
filtering on RID.
MozReview-Commit-ID: E54HCGLVYDk
--HG--
extra : rebase_source : b53085f23cb6558611aa7622f55637e19439c9c3
We sometimes briefly have more than one root DocAccessible associated with a TabChild, for example, while navigating links in a page. This patch makes sure that we use the correct accessible when delaying messages that we forward to the parent process.
This commit adds a telemetry probe to determine the percentage of pages
that ever have a 'mousemove' event listener added to the DOM. This is for
determining how often APZ key scrolling could handle interleaved mousemove
events.
A flag is added to nsPIDOMWindow to track whether a qualifying event
listener was ever added to the DOM for this window, and is updated by
EventListenerManager. There are several other similar flags to this.
The probe is reported in nsGlobalWindow::FreeInnerObjects() so that it
can be compared exactly with the non-passive keyboard listener APZ probe.
MozReview-Commit-ID: DqqCfrdRCGp
--HG--
extra : rebase_source : fad8159c28b587572a4191f7cbde1e97e166639c
This commit adds a telemetry probe to track the percentage of pages that ever
have a non-passive 'keydown' or 'keypress' event that could preventDefault()
APZ key scrolling of the root of a page.
A flag is added to each EventListenerManager to track whether it ever had
a qualifying event listener, and then in nsGlobalWindow::FreeInnerObjects()
the event targets that could preventDefault() a scroll are checked for this
flag. This check is done at nsGlobalWindow::FreeInnerObjects() so that the
DOM is still alive.
MozReview-Commit-ID: EkK3vxehZA5
--HG--
extra : rebase_source : 4642189d0065254cf74dfe8475403f0bf8210bca
If a CC takes too long (around 50 slices) or gets interrupted by a GC,
we have to finish it synchronously, which can cause a big pause. This
patch tries to avoid that by eagerly increasing the slice budget the
longer a CC goes on. It linearly increases the slice time from 5ms to
40ms as we approach the halfway point of a CC (1 second), matching GC
pauses, and then leaves it at 40ms.
MozReview-Commit-ID: 8TKZ0ZuxsUA
--HG--
extra : rebase_source : 2c46e56ecaa47242177d8cce53a208f08f5cabe2
Discussion at <https://github.com/whatwg/dom/issues/319>. In short, the
specification used to say to throw sometimes InvalidCharacterError and
sometimes NamespaceError, but browsers disagreed on which to throw in
corner cases, and everyone agreed it wasn't worth the effort to spec the
distinction, so we just changed it to InvalidCharacterError across the
board.
The test changes are already upstream.
MozReview-Commit-ID: AWSZBznQprG
--HG--
extra : rebase_source : 2f0051f48124380f17300a38ceb8c2ab23015ca1
The APZ scrolling codepath doesn't do the right thing for <listbox>
without special handling, so have it scroll in JS instead, like we
did in bug 1302736 for <tree>.
MozReview-Commit-ID: LWJCBfhZ3Hc
--HG--
extra : rebase_source : bb8b2f7e713d35822a956e08f4e0eed0557b07b3
The EME spec requires EME to be only usuable from a secure context, for example
from an origin served over HTTPS. We still don't enforce this, and Chrome is
going to start enforcing this in M58. So to inform our decision as to when to
start enforcing this, it would be useful to know how many sites we'd break if
we started enforcing this.
So this patch adds telemetry to tell us the how often EME is used on secure
and non-secure contexts.
MozReview-Commit-ID: BKS5iY4V3wK
--HG--
extra : rebase_source : 77b98516e0d8a0471f8c7a1e5bf54bcf9f74b7da
Currently, attribute and child arrays (implemented in dom/base/nsAttrAndChildArray.h) start out empty. When cloning, the array ends up being resized multiple times in order to add the attributes and children that are being cloned from the original node. This would be quicker if the array was initialized to the correct size in the first place so that resizes are not necessary.
However, preallocating space for children is only necessary when performing a deep clone. Therefore, an additional parameter is being added to the Clone, CopyInnerTo, and CloneDocHelper methods to indicate whether preallocation of children should happen. Attributes are copied either way, so that part of the array is preallocated in both cases.
MozReview-Commit-ID: 3iVezeAKXnI
--HG--
extra : rebase_source : 9c3deec6d7aafd6411044d623d4863637b45fd58
XPCJSContext::Get() now does a TLS lookup, which is a little more expensive
than looking up a global variable. This patch removes as many of the TLS
lookups as possible.
MozReview-Commit-ID: GsqzJn55Lya
The ChromiumCDMParent is informed of the shutdown of its plugin, so we can
use that to inform the CDMProxy that its connection to the CDM has been
severed. This means we shutdown cleanly if the browser closes while playing.
MozReview-Commit-ID: HphQ2exu1gj
--HG--
extra : rebase_source : ff9ee3699915e8b7527570e839eb3bb0a0ab46bc
We are pre-allocating shmems in the content process for use by the CDM in the
GMP process. We guess the size of shmem required. However if we guess wrong,
currently we always end up taking the non-shmem path for video frames to
return to the content process, which results in us sending another shmem
(of the wrong size) to the CDM, and this continues until we hit the limit
on the number of shmems that we tolerate the CDM asking for.
So in this patch, I change our behaviour to detect when we're allocating
shmems that are too small, whereupon we purge the existing shmems and switch
to allocating them at the size being requested by the CDM.
This means we recover from incorrectly guessing the size of shmems required
by the CDM. The overhead of an incorrect guess should be one video frame
transferred via the nsTArray path.
MozReview-Commit-ID: 8o1s7FI2UBd
--HG--
extra : rebase_source : 0612d199686278612e8c58dc97e96a9304ea3ee9
When profiling nsDocumentEncoder::EncodeToStringWithMaxLength for text/plain, 25% is Preferences::GetBool into nsPlainTextSerializer::Init. So we should use AddBoolVarCache for it.
MozReview-Commit-ID: 9CVd4OZzzr5
--HG--
extra : rebase_source : 6b860927b64109ae41a07a161f47612df2f176b7
PLayerTransaction's constructor was previously synchronous so we could
return a TextureFactoryIdentifier. This is quite reliably available
already in the case of opening a tab, due to RenderFrameParent knowing
which compositor it is attached to, so we can make the constructor
asynchronous.
In the top-level widget case, we add a new synchronous message to find
the TextureFactoryIdentifier.
--HG--
extra : rebase_source : 4b29b859aa5745fabe3db0fe68742328fc0af175
The test doesn't verify that the exceptions are reported to the browser console,
but I manually checked that they are. Adding a test for that part could be
pretty annoying.
The JS engine has a notion of ZoneGroup that we plan to use as
the unit of threading for Quantum DOM. We want to create one
ZoneGroup per TabGroup so that the two concepts are 1:1.
MozReview-Commit-ID: IDmGGRZBNpQ
If a child-to-parent IPCBlob is more than 1mb, we end up using a pipe stream.
If that ipcBlob is sent to a different process, we need to implement asyncWait
correctly: we need to call the remoteStream->AsyncWait().
nsInputStreamPump should use the stream as nsIAsyncInputStream if available.
In order to do so, we need to wrap a BufferedStream around it.
MediaResource cannot use a simple sync nsIInputStream when BlobURL are involved
in the content process.
This patch will go away when I'll finishing the removing of PBlob. Currently,
when a PBlob is sent from child to parent, we use PMemoryStream in order to
recreate the inputStream on the parent side. PMemoryStream sends the data in
chunks.
But if PBlob is dealing with a IPCBlobInputStream, it doesn't have access to
the real data. In this case, we must send data using IPCStream. In this way,
Note that thisIPCBlobInputStream will send its ID, and the parent will take the
real inputStream from the IPCBlobInputStreamStorage. Note that I check the
size to be 1mb instead 0. No particular reasons, but better to avoid the use of
PMemoryStream for nothing.
Currently FileReader API uses a nsITransport. This is not needed if the
inputStream is a nsIAsyncInputStream already, and IPCBlobInputStream is always
a nsIAsyncInputStream.
Note that, we must create a bufferedStream in order to use ReadSegments in case
the remote inputStream, received by IPCBlobInputStream, is a FileInputStream.
This was not needed with nsITransport.
IPCBlobInputStream must implement nsIIPCSerializableInputStream interface.
When this is done, the child sends the internal ID of the IPCBlobInputStream to
the parent.
An IPCBlobInputStream can be sent back to the parent process (not implemented
in this patch). When this is done, we basically send only the internal ID.
From this ID, we can retrieve the original inputStream because any
IPCBlobInputStreamParent actor has previously registered it into a singleton:
IPCBlobInputStreamStorage.
So, if we have a IPCBlobInputStreamParent, we have an inputStream, and this
inputStream is known by IPCBlobInputStreamStorage. This will be useful in the
next patches.
IPCBlobInputStream is a new type of nsIInputStream that is used only in content
process when a Blob is sent from parent to child. This inputStream is for now,
just cloneable.
When the parent process sends a Blob to a content process, it has the Blob and
its inputStream. With its inputStream it creates a IPCBlobInputStreamParent
actor. This actor keeps the inputStream alive for following uses (not part of
this patch).
On the child side we will have, of course, a IPCBlobInputStreamChild actor.
This actor is able to create a IPCBlobInputStream when CreateStream() is
called. This means that 1 IPCBlobInputStreamChild can manage multiple
IPCBlobInputStreams each time one of them is cloned. When the last one of this
stream is released, the child actor sends a __delete__ request to the parent
side; the parent will be deleted, and the original inputStream, on the parent
side, will be released as well.
IPCBlobInputStream is a special inputStream because each method, except for
Available() fails. Basically, this inputStream cannot be used on the content
process for nothing else than knowing the size of the original stream.
In the following patches, I'll introduce an async way to use it.
This is the first use of IPCBlob: ClonedMessageData.
ClonedMessageData is used for BroadcastChannel, MessagePort and any
postMessage() communication. This patch changes StructuredCloneData in order to
use IPCBlob instead of PBlob.
BroadcastChannel has a custom way to manage Blobs because when the parent
receives them from a content process, it must send them to any other
BroadcastChild actor duplicating the serialization.
This first patch introduces the basic idea of the refactoring. Instead of
having a PBlob protocol, here we have a simple IPC struct: IPCBlob.
When a Blob is sent to a different process, we move an IPCBlob struct with
type, size, some specific File properties, and an inputStream as IPCStream.
We need 'dom.animations-api.core.enabled' preference to test animation.
In this patch, set the preference before DOMWindowUtils test with animation.
MozReview-Commit-ID: 9lz0hWvyo83
--HG--
extra : rebase_source : 1972bab70063a354efb57115b8ffed9e1bb41623
This patch replaces the usage of sNextTabParent pointer to store the next
PBrowser parent actor to be used by the next frame loader with the
following information:
* In the case where the content JS has requested a new tab, the ID of the
next TabParent will be stored on the <xul:browser> element.
* In the case where the content JS has requested a new window, the ID of
the next TabParent will be stored on the created nsXULWindow.
For testing IMEContentObserver, text change, selection change and position change notifications should be exposed to JS with nsITextInputProcessorNotification.
MozReview-Commit-ID: 3PUhKXRwnAn
--HG--
extra : rebase_source : fce7a73683a2d4811070453629ef48d3ad15c8c8
nsIFilePicker.displaySpecialDirectory is a string that can be set to TmpD,
Desk, or any other special directory value. The real value of this directory
will be read in the parent process.
This filtering is no longer necessary now that the fix for Bug 1338897 has landed and has gotten rid of the CRLF behaviour.
MozReview-Commit-ID: 9OKmrtQN3Cq
--HG--
extra : transplant_source : %C2%CD%AC%F6j%F5%D0%00%7E%AC%D2j%ACW%83%60%3B%F0%ED%CC
TimeStamp::ProcessCreations()'s aIsInconsistent outparam is ignored by the
majority of its caller. This patch makes it optional. Notably, this makes
ProcessCreation() easier to use in a constructor's initializer list.