Граф коммитов

64972 Коммитов

Автор SHA1 Сообщение Дата
Kaku Kuo 1226fb4d2c Bug 1380244 - trigger skip-to-next-key-frame quicker; r=jya
This patch is going to loose the criteria of skip-to-next-key-frame.

The original rules are here:
http://searchfox.org/mozilla-central/rev/31311070d9860b24fe4a7a36976c14b328c16208/dom/media/MediaFormatReader.cpp#1559

Skip-to-next-key-frame is triggered if the playback position is LARGER than the next key frame time.
But, from the video-track point of view, when the skip-to-next-key-frame is triggered, it skips to the next-next key frame.

Here is an example, say, we are playing a media file with its playback position at time _a_,
and its video decoding is falling behind at time _v_.
The next key frame is at time _k1_ and next-next key frame is at time _k2_.

              a
----|---------|---------|-------------|----------------> time
    v                   k1            k2

When the playback position _a_ passes _k1_ (_a_ > _k1_), the skip-to-next-key-frame is triggered,
and the demuxer jumps to _k2_ directly.



The idea here is to give a chance when (_a_ == _k1_), let demuxer jump to _k1_ and see if the video decoding could catch up.

MozReview-Commit-ID: 6aRSYDOI1ds

--HG--
extra : rebase_source : c448df7af9f83b9127bad9bae28f353b40669b7f
2017-07-12 16:16:49 +08:00
Nils Ohlmeier [:drno] 0130c59aaf Bug 1264479: added implementation for [current|pending][Local|Remote]Description. r=bwc
MozReview-Commit-ID: AAnuN3YRhFH

--HG--
extra : rebase_source : 8b68125b5073783720fd5007973e4fad638698a9
2017-06-30 01:19:19 -07:00
Nils Ohlmeier [:drno] d14f89ffa2 Bug 1264479: added [current|pending][Local|Remote]Description to WebIDL. r=smaug
MozReview-Commit-ID: JwRyKtZMKzl

--HG--
extra : rebase_source : cc10f4efea212126f1ab56cf2fd3553f51c555c4
2017-06-30 01:18:46 -07:00
Sebastian Hengst 65c3b9ff62 Backed out changeset b223c191f442 (bug 1355746) for frequently failing mochitests with: /tests/dom/base/test/test_data_uri.html logged result after SimpleTest.finish(): iframe should have NullPrincipal. r=backout 2017-07-12 19:20:11 +02:00
Sebastian Hengst 93749c3cde Backed out changeset e0fd0ae58d0f (bug 1355746) 2017-07-12 19:19:22 +02:00
Sebastian Hengst d4f6c2cc4f Backed out changeset 8a5e11d641cc (bug 1355746) 2017-07-12 19:19:13 +02:00
Mark Banner 35f3666937 Bug 1380009 - Enable the ESLint no-return-await call to avoid unnecessary intermediate promise creation. r=mossop
MozReview-Commit-ID: EnhSBHMjurr

--HG--
extra : rebase_source : 74ba4c10e369067629af95bf705a9acd0df1089b
2017-07-11 22:49:55 +01:00
Henry Chang 0c2ccd15fe Bug 1355746 - Part 4. Fix intermittent full screen test failures. r=smaug,xidorn
We found that a window will not get focus immediately after exiting full screen
mode on Linux. This seems to be a long-standing issue which surfaces due to the
change of background HTML parsing timing. So, we try to get focus everytime
before requesting full screen mode to ensure the request will not fail because
of the focus issue.

MozReview-Commit-ID: 2pOShFZcq8A

--HG--
extra : rebase_source : a92fad6a5e31e7387824da42ef2655a0f7ba002f
2017-07-12 10:49:11 +08:00
Henry Chang 602eed5546 Bug 1355746 - Part 2. Polish IdleTaskRunner and reuse it for background parsing. r=smaug
This patch is mainly to make IdleTaskRunner reusable by nsHtml5TreeOpExecutor.
The only necessary work to that purpose is to remove the dependency of
sShuttingDown, which was a static variable in nsJSEnvironment.cpp.
The idea is to have a "ShouldCancel" as a callback for the consumer to
return sShuttingDown.

In addition to sShuttingDown, we use std::function<bool()> as the runner
main callback type.

MozReview-Commit-ID: FT2X1unSvPS

--HG--
extra : rebase_source : dc9bcf669a95dda5c40bccde2cbc836099536eb5
2017-07-12 09:23:15 +08:00
Henry Chang f991045c00 Bug 1355746 - Part 1. Rename CollectRunner to IdleTaskRunner and move to xpcom/threads/IdleTaskRunner.h/cpp r=smaug
Nothing is changed in this patch except for renaming and code move around.
The strategy is to have the final file setup in this patch without any
detail change. The actual code change will be in the next patch so that
we can focus on reviewing the diff in the next patch regarding IdleTaskRunner.

MozReview-Commit-ID: 4Bul9mZ7z1n

--HG--
extra : rebase_source : 22aeb5dca58501ec335ef8bc7b0efb6aea565bbf
2017-07-12 09:18:57 +08:00
Carsten "Tomcat" Book bf8ecdbf1a Merge mozilla-central to autoland 2017-07-12 11:18:59 +02:00
Carsten "Tomcat" Book 0edfa97e38 merge mozilla-inbound to mozilla-central a=merge 2017-07-12 11:07:09 +02:00
Makoto Kato 1b41d2ecf8 Bug 943276 - Remove unused nsIPlatfromCharset. r=emk
By bug 1261841, we don't use nsIPlatfromCharset on PluginTags.  So we should remove unused header.

MozReview-Commit-ID: 8Y4YwRzTJuk
2017-07-10 12:37:56 +09:00
Yoshi Huang 9ff74a50f4 Bug 1373513 - Part 3: Revert Bug 1363634. r=ckerschb
Revert what we did in Bug 1363634, from the spec, data:text/css should be same origin.
2017-07-12 11:00:34 +08:00
Yoshi Huang 41473dd86d Bug 1373513 - Part 2: Revert Bug 1364367. r=ckerschb
Revert what we did in Bug1364367, as data URI for -moz-binding should be
same origin.
2017-07-12 11:00:27 +08:00
Yoshi Huang 94d1d69dc1 Bug 1373513 - Part 1: data:image, data:css, and data:fonts should be same origin. r=smaug
For font-face
https://drafts.csswg.org/css-fonts-3/#font-fetching-requirements

/* data url's with no redirects are treated as same origin */
src: url("data:application/font-woff;base64,...");

For image
https://html.spec.whatwg.org/multipage/images.html#updating-the-image-data
Step 12
 Fetch request. Let this instance of the fetching algorithm be
associated with image request.

This will go to Fetch spec then.

For <link rel="stylesheet" href="data:text/css" ...>
https://html.spec.whatwg.org/multipage/semantics.html#obtaining-a-resource-from-a-link-element
Step 10
Fetch request.

This will also go to Fetch spec then.

[Fetch] specification,
https://fetch.spec.whatwg.org/#main-fetch, step 12,
request’s current url’s scheme is "data"
1. Set request’s response tainting to "basic".

And from
https://html.spec.whatwg.org/multipage/urls-and-fetching.html#terminology-3
A response whose type is "basic", "cors", or "default" is
CORS-same-origin.

For subresource loading using data: URI, it should be treated as same
origin.
2017-07-12 11:00:13 +08:00
Bryce Van Dyk 1b35f7626e Bug 1378826 - Remove direct track listeners for video tracks if MediaRecorder is notified of their removal. r=jesup
--HG--
extra : rebase_source : cdd2f7070fab1ad1491d272819e0be524d9583fd
2017-07-11 09:14:28 +12:00
Emilio Cobos Álvarez dc33155ad6 Bug 1379505: Allow calling GetBaseComputedStylesForElement for an unstyled element. r=boris
Before this refactoring, getComputedStyle could have side effects, and left the
style data in the element, so we could never arrive there without data.

There are a few crashtests that caught this, but this was already broken if you
called animate() on an element deep in a display: none subtree.

MozReview-Commit-ID: 1AvOvhAyOP3

--HG--
extra : rebase_source : 0a920df8809961f784026a14a624d8eafb4cc79f
2017-07-10 13:33:21 +02:00
Brian Birtles 4ec9d9a3c9 Bug 1370123 - Skip restyling elements in documents without a pres shell; r=heycam
The previous patch takes the approach that we should simply not add elements in
documents without a pres shell to EffectCompositor's set of elements to restyle.
However, there exists a case where we might have an element in a displayed
document, then we might tickle it so that it requests an animation restyle, and
then move it to a document without a browsing context. In that case we should
skip the element when we next do animation restyles.

However, even if we successfully skip the element in the document without a pres
shell, we need to make sure it eventually gets removed from the set of elements
to restyle rather than simply remaining there forever. For that reason this
patch makes us unconditionally clear the set of elements to restyle whenever we
do a full restyle from the root.

This patch also adds a test case to trigger the scenario outlined in the first
paragraph above. I have confirmed that without the code changes in this patch,
if we simply assert that target.mElement has an associated pres shell in
getNeededRestyleTarget, then that assertion will fail when running this test
case.

MozReview-Commit-ID: ED2X5g39hYZ

--HG--
extra : rebase_source : 06fecc98c25c739d26123bddf1fd0908cf4410e6
extra : source : 12c7a036215a901bf6804c0e9aacd2a9fc20f932
2017-06-21 14:45:24 +09:00
Brian Birtles 9696b59052 Bug 1370123 - Ignore animation restyle requests for elements in documents without a pres shell; r=heycam
This patch makes us ignore animation restyle requests for elements in documents
without a pres shell made by either:

* Calls to EffectCompositor::RequestRestyle (e.g. by calling Web Animations API
  methods on animations that target such elements)

* Calls to EffectCompostior::PreTraverse(dom::Element*, CSSPseudoElementType)
  (e.g. by calling getComputedStyle(elem).prop on such an element).

  The other overloads of PreTraverse should presumably be called during regular
  document restyling where the element is expected to be in a displayed document
  and hence we simply assert that that is the case for those methods.

MozReview-Commit-ID: FZD0hKAXYEf

--HG--
extra : rebase_source : 9b9ddf4648b49e0241054ffa51a02ae66f1c5009
2017-06-21 08:48:21 +09:00
Brian Birtles f5f71f7eb5 Bug 1370123 - Add tests for Element.animate when used on an element in a document without a browsing context; r=xidorn
MozReview-Commit-ID: FL37UKP6s3k

--HG--
extra : rebase_source : e71da012708f2df179049cee9a1dedc875ff13af
2017-06-19 12:19:57 +09:00
Boris Zbarsky 1b5d0a8ea1 Bug 1370550. Move the onwheel attribute to GlobalEventHandlers, to follow the spec. r=smaug 2017-07-11 17:49:25 -04:00
Boris Zbarsky 28db637afa Bug 1379728 part 2. Add assertions to ensure we don't multiple-define events in our event name list. r=smaug 2017-07-11 17:49:25 -04:00
Boris Zbarsky 49dbf6fa43 Bug 1379728 part 1. Remove the double-definition of the 'close' event from EventNameList.h. r=smaug 2017-07-11 17:49:24 -04:00
Eric Rahm 3862a0db5c Bug 1376038 - Part 3: Combine ghost window reporter with window reporter. r=njn
This combines the GhostWindowsReporter with the nsWindowMemoryReporter. It has
the benefit of removing a reporter of a single value and also guarantees that
we use the latests ghost windows value that is calculated in
|nsWindowMemoryReporter::CollectReports| rather than a possibly cached value
from a previous run.
2017-07-11 13:58:23 -07:00
Eric Rahm eff9ba861a Bug 1376038 - Part 2: Cache base domains during ghost window calculation. r=mccr8
Avoid hitting the rather slow effective TLD service by caching results when
mapping URLs to their base domains. In testing the cache ranged from a 1:1 to
a 3:1 hit:miss ratio.
2017-07-11 13:58:21 -07:00
Eric Rahm 0dc3c70d24 Bug 1376038 - Part 1: Use a cached ghost window value for the distinguished amount. r=mccr8
We already periodically calculate the ghost window amount after cycle
collection, this just uses a cached value of that for the distinguished amount.
This avoids the overhead of a recalculating the value when reporting telemetry.
2017-07-11 13:58:20 -07:00
Gabor Krizsanits cb84415a1f Bug 1373660 - Block the preallocated process manager while a content process is being launched. r=mrbkap
We should not let the ppm to do work before the first paint in a new cp. This patch
makes sure that we only let the ppm spawn a new process after the last process reached
an idle state AND the main process becomes idle too.
2017-07-11 17:30:08 +02:00
Jessica Jong 5b8ce74fb3 Bug 1379108 - Factor GetValidationMessage() out of HTMLInputElement. r=smaug
MozReview-Commit-ID: IFQXQTxoD9T

--HG--
extra : amend_source : 4f2a7ee7b0b6e96612add014cee6e95e6b72b44c
2017-07-10 19:10:00 -04:00
Carsten "Tomcat" Book 7e0d52f50e Merge mozilla-central to inbound 2017-07-11 13:00:28 +02:00
Carsten "Tomcat" Book 31311070d9 merge mozilla-inbound to mozilla-central a=merge 2017-07-11 12:51:59 +02:00
Tim Taubert aac46d1b3e Bug 1379580 - U2FTokenTransport promises should resolve to U2F data buffers r=qDot 2017-07-11 11:09:08 +02:00
Stone Shih 1da6cd22e9 Backed out changeset 367b6f947f87 (bug 1370630) for breaking mozilla-internal jenkins site. r=backout. 2017-07-11 15:59:03 +08:00
Carsten "Tomcat" Book 31c3b0bf6f Backed out changeset 7b267e692c04 (bug 1379864) for assertion failure in stylo tests 2017-07-11 09:07:53 +02:00
Carsten "Tomcat" Book 33a98da603 Backed out changeset 57800baf24a3 (bug 1379864) 2017-07-11 09:06:27 +02:00
Christoph Kerschbaumer 250d4b1ff8 Bug 1377426 - Set CSP on freshly created nullprincipal when iframe is sandboxed. r=dveditz 2017-07-11 08:48:37 +02:00
Cameron McCormack 8bd2257ed4 Bug 1379864 - Followup fix. r=me 2017-07-11 11:33:34 +08:00
Cameron McCormack d6733c3803 Bug 1379864 - stylo: Remove <style scoped> warning. r=xidorn
MozReview-Commit-ID: 6hUcdLAeaxs

--HG--
extra : rebase_source : c2a38ca757a1864b060fbbb112881dd9806ac46d
2017-07-11 10:35:54 +08:00
Bevis Tseng f051ae4a45 Bug 1341540 - Label runnables in dom/html/HTMLMediaElement.cpp. r=jwwang
MozReview-Commit-ID: 7i0MhGWoNPb

--HG--
extra : rebase_source : 577a231ac5ed3658311eacd19cd3fe912fdee0b0
2017-07-07 10:36:13 +08:00
David Anderson dd94534a4f Disable Advanced Layers when the sanity test fails. (bug 1377866 part 3, r=mchang) 2017-07-10 19:30:52 -07:00
Perry Jiang 211a8becfd Bug 1377251 - Expose TIME_TO_NON_BLANK_PAINT as Performance Entry behind pref. r=qDot 2017-07-05 16:51:50 -07:00
Wes Kocher 8e3be4c671 Merge inbound to central, a=merge 2017-07-10 18:43:02 -07:00
Boris Zbarsky d226db3321 Bug 1371259 followup. Fix rooting analysis hazards in UnwrapObjectInternal. r=peterv pending 2017-07-10 18:04:49 -04:00
Wes Kocher b43f3b0d25 Backed out 2 changesets (bug 1344751) for frequent android crashes in test_fetch_cors_sw_reroute.html a=backout
Backed out changeset ec02a5ecb2b4 (bug 1344751)
Backed out changeset 10c975d4a8f9 (bug 1344751)

MozReview-Commit-ID: GauB18HNj15
2017-07-10 14:17:35 -07:00
Boris Zbarsky 66481a7a29 Bug 1371259 part 9. Make UnwrapReflectorToISupports return already_AddRefed<nsISupports>. r=peterv
The main reason to not do this would be performance (avoiding the
addref/release), but there are two main mitigating factors:

1)  All calls to UnwrapReflectorToISupports that pass in a Web IDL object
    already do the addref (and in fact QI).  So this only affects the
    XPCWrappedNative case.

2)  The vast majority of the callers proceed to QI on the pointer anyway, and a
    second addref is cheap; it's the first addref after a CC that can be
    expensive on a cycle-collected object.

Going through the changes one by one:

* In GlobalObject::GetAsSupports, we do have a change that slightly slows down
  precisely in the XPCWrappedNative global case.  That's the message managers
  and the backstagepass.  And this really only affects calls to Web IDL statics
  from those globals.

* In UnwrapArgImpl we're talking about a Web IDL method taking an "external
  interface" type, and the UnwrapReflectorToISupports call is immediately
  followed by QI anyway.

* In UnwrapXPConnectImpl we're talking about the case when we have a
  non-WebIDL-object implementation of a Web IDL interface.  Again, this is the
  message manager globals, for EventTarget.  And we have a QI call immediately
  after the UnwrapReflectorToISupports.

* In the generated HasInstance hook for EventTarget we will be slightly slower
  when the LHS of the instanceof is an XPCWrappedNative.  And not much slower,
  because again there's an immediate QI.

* In InstallXBLField we're never going to have an XPCWrappedNative as thisObj;
  it's always an Element in practice.  So this is no more expensive than before.

* In sandbox's GetPrincipalOrSOP we now have an extra addref.  But it was
  followed by various QIs anyway.

* In XPCConvert::JSValToXPCException we have an extra addref if someone throws
  an XPCWrappedNative, which is fairly unlikely; our actual Exception objects
  are on Web IDL bindings.  Plus we have an immediate QI.

* In xpc::HasInstance we have an extra addred if the LHS of instanceof is an
  XPCWrappedNative.  But, again, there's an immediated QI after the
  UnwrapReflectorToISupports.

* In xpcJSWeakReference::Init we are likely doing an extra addref, but again
  immediately followed by QI.

I think it's worth making this change just to remove the footgun and that the
perf impact, if any, is pretty minimal.
2017-07-10 16:05:26 -04:00
Boris Zbarsky 9cdb2834a8 Bug 1371259 part 8. Get rid of nsIXPConnect::GetNativeOfWrapper. r=peterv
Most of these changes are just replacements of GetNativeOfWrapper with
UnwrapReflectorToISupports, which is all it did under the hood.

The other changes are as follows:

* In nsDOMClassInfo, we really care whether we have a window, so we can just
  UNWRAP_OBJECT to the Window interface, since Window is always on Web IDL
  bindings now.  Also, the weird compartment check hasn't been needed ever since
  GetNativeOfWrapper stopped returning things off the passed-in object's
  prototype chain (Firefox 22, bug 658909).
* The only use of do_QueryWrapper was to get a Window in nsDocument; again we
  can UNWRAP_OBJECT.
* In XPCJSRuntime, we again just want to check for a Window, so UNWRAP_OBJECT.
2017-07-10 16:05:25 -04:00
Boris Zbarsky cdd8fe10d4 Bug 1371259 part 4. Stop using UnwrapArg to unwrap this values. r=peterv 2017-07-10 16:05:25 -04:00
Boris Zbarsky 5c76874a46 Bug 1371259 part 3. Change UnwrapObject<> and the UNWRAP_OBJECT macro to allow passing in mutable object or value handles for the thing being unwrapped, and do so at various callsites. r=peterv
I did audit all UNWRAP_OBJECT callers to make sure that the lifetimes of all the
temporary Rooted or the RefPtrs they unwrap into are long enough.
2017-07-10 16:05:24 -04:00
Boris Zbarsky 5fd161c633 Bug 1371259 part 2. Change union conversions for non-owning unions to pass a MutableHandle through to the underlying conversion code. r=peterv 2017-07-10 16:05:24 -04:00
Boris Zbarsky 6ed5936b6b Bug 1371259 part 1. Pass maybe-mutable Value handles, not JSObject*, into CastableObjectUnwrapper. r=peterv
The idea is that CastableObjectUnwrapper will want to have a MutableHandle for
the thing it's unwrapping whenever its target is a raw pointer.  Since we have
convenient MutableHandle<Value> in most cases, it's easier to switch
CastableObjectUnwrapper to working with MutableHandle<Value> or Handle<Value>
instead of trying to get MutableHandle<JSObject*> in the right places.

There are basically two changes here:

1) Make CastableObjectUnwrapper work with at thing that looks like a Value.
2) Change various callsites to pass in MutableHandle<Value>, in addition to a
   Handle<Value>, into the JS-to-C++ conversion templates.  The
   MutableHandle<Value> is passed as ${maybeMutableVal}.  It may not actually
   end up being a MutableHandle in some cases.

The reason for passing both a Handle and a MutableHandle is that when the thing
we actually have is a Rooted named "foo" the Handle will be "foo" but the
MutableHandle is most naturally written as "&foo".  This is not a problem if
you're just passing it through, but if you want to test whether it's an object,
say, you have a problem.  Writing "foo.isObject()" is ok, but "&foo.isObject()"
is not, and neither is "(&foo).isObject()".  This could be worked around by
passing the MutableHandle as "JS::MutableHandle<JS::Value>(&foo)" or something,
and then "JS::MutableHandle<JS::Value>(&foo).isObject()" does work.  But it
makes the code very hard to read.

So we just pass both things along; ${val} should be used for readonly access and
${maybeMutableVal} any time you really want a MutableHandle.
2017-07-10 16:05:24 -04:00