gecko-dev/dom
Brian Birtles ebedef2a25 Bug 849593 - Skip samples of active SMIL timed elements when the sample time precedes the current interval; r=dholbert
In some circumstances it is possible to sample a timed element in the active
state with a time that precedes is current interval.

One possible sequence of steps leading to this situation is as follows:

1. A timed element (e.g. <set>, <animate>) with a non-zero begin time is the
   child of <svg> element A (its "time container") but has yet to be sampled.

2. In order to resolve its initial interval, the timed element registers a
   startup milestone with its time container at time 0.

3. However, before the sample is performed where the timed element's initial
   current interval is resolved, <svg> element A is detached from the document
   tree.

4. The timed element is then attached to a different <svg> element B that has
   a current time greater than the begin time of the timed element and less than
   that of <svg> element A.

5. Since the timed element is still in its startup state it registers its
   startup milestone again, this time with its new time container, i.e. <svg>
   element B.

6. A tick occurs or the document has its style flushed such that a sample is
   performed.

   This includes running the milestone sample which causes the timed element to
   resolve its initial current interval. Furthermore the subsequent regular
   sample of the timed element causes it to transition into its active state
   because the current time of <svg> element B is greater than the begin time of
   the timed element.

7. <svg> element A is re-attached to the document.

8. When we go to run the next sample, we iterate through all time containers
   associated with the document's animation controller which includes both <svg>
   element A, and <svg> element B.

9. <svg> element A renders up its 0 milestone from step (2) since it has yet to
   run it. It converts this to parent time, i.e. the time space of the animation
   controller, which will be zero or less depending on the current time of <svg>
   element A when it was re-attached.

10. Since the milestone from <svg> element A will be the earliest milestone
    time, it will be used as the next milestone sample time.

11. The timed element is then sampled using this time, but first it is converted
    to a time in the time space of the timed element's time container, which is
    now <svg> element B.

    As a result of this conversion, the sample time may end up being *before*
    the beginning of the timed element's current interval. Since timed elements
    never expect the time to go backwards an assertion fails when it detects
    that it is active, but is being sampled before its current interval.

For this particular case, ignoring the "early" sample seems to be the most
appropriate action.

More generally, however, we can anticipate other cases similar to this where
milestones are registered that cause the sample time to temporarily go
backwards. A quick audit of nsSMILTimedElement::DoSampleAt suggests that, with
the code changes from this patch, that is probably ok.

As an alternative we could, perhaps, try to drop and re-create all milestones
when time containers are re-attached to the document tree but that would add
more complexity and would not necessarily cover other similar cases of this
situation.

I have verified that the crashtest included in this changeset fails without the
code changes also in this changeset.

MozReview-Commit-ID: KKGYRayNkpo

--HG--
extra : rebase_source : 832d4b357a2a2fe07abf9eab3a6046599aff3ef5
2017-10-24 13:06:04 +09:00
..
abort Bug 1408777 - Automatically fix instances of missing semicolons in the tree. r=Standard8 2017-10-15 20:50:39 +01:00
animation Bug 1383239 - Don't throttle non-visible changes involved animations on out-of-view elements when they are newly in-effect. r=birtles 2017-10-20 18:23:44 +09:00
asmjscache Bug 1408333 Get rid of nsIIPCBackgroundChildCreateCallback - part 6 - AsmJS, r=asuth 2017-10-24 12:02:40 +02:00
audiochannel
base merge mozilla-central to autoland. r=merge a=merge 2017-10-24 23:59:14 +02:00
battery
bindings merge mozilla-central to autoland. r=merge a=merge 2017-10-24 23:59:14 +02:00
broadcastchannel Bug 1408333 Get rid of nsIIPCBackgroundChildCreateCallback - part 1 - BroadcastChannel, r=asuth 2017-10-24 12:02:39 +02:00
browser-element Bug 1406224 - Remove nsIDOMHTMLImageElement; r=bz 2017-10-06 13:27:23 -07:00
cache Bug 1408333 Get rid of nsIIPCBackgroundChildCreateCallback - part 12 - Cache API, r=asuth 2017-10-24 12:02:40 +02:00
canvas Bug 1410306 - Disable dom/canvas/test/webgl-conf/generated/test_2_conformance__glsl__misc__shader-uniform-packing-restrictions.html on win7/debug for frequent failures. r=me, a=testonly 2017-10-24 12:37:25 -04:00
commandhandler
console Bug 1403866 - No AutoSafeJSContext in Console.cpp, r=bz 2017-09-29 09:20:58 +02:00
credentialmanagement Bug 1407829 - WebAuthn: Implement CredMan's Store method r=qdot,ttaubert 2017-10-12 17:02:22 -07:00
crypto Bug 1401803 - WebAuthn types need to return ArrayBuffers r=keeler 2017-09-20 07:32:07 -07:00
encoding Bug 1406819 - Remove various bits of dead code from dom/. r=baku 2017-10-11 10:09:13 +01:00
events Backed out changeset dab1c5badddb (bug 1407679) for failing server startup in mochitests on Android. r=backout on a CLOSED TREE 2017-10-24 21:18:26 +02:00
fetch Bug 1380255 P2 Don't fire FetchDriverObserver::OnDataAvailable() for every FetchDriver ODA callback. r=baku 2017-10-12 19:23:16 -07:00
file Bug 1408333 Get rid of nsIIPCBackgroundChildCreateCallback - part 5 - IPCBlob, r=asuth 2017-10-24 12:02:40 +02:00
filehandle Bug 1404845 - Renaming BlobImpl::GetInternalStream to BlobImpl::CreateInputStream, r=smaug 2017-10-02 13:53:12 +02:00
filesystem Bug 1408333 Get rid of nsIIPCBackgroundChildCreateCallback - part 7 - FileSystem APIs, r=asuth 2017-10-24 12:02:40 +02:00
flyweb Bug 1404198: Part 2i - Switch to NS_NewTimer* in dom. r=njn 2017-10-15 23:15:40 -07:00
gamepad Bug 1408333 Get rid of nsIIPCBackgroundChildCreateCallback - part 10 - Gamepad API, r=asuth 2017-10-24 12:02:40 +02:00
geolocation Bug 1404198: Part 2i - Switch to NS_NewTimer* in dom. r=njn 2017-10-15 23:15:40 -07:00
grid
html Bug 638054 - Remove or fix tests outside JS using watch/unwatch. r=bz,fitzgen 2017-10-24 20:48:14 +02:00
imptests
indexedDB Bug 1410142 - use NS_NewLocalFile in dom/; r=baku 2017-10-23 14:22:14 -04:00
interfaces Bug 1340415 - Ensure main-thread and async autoscrolling do not happen at the same time. r=kats 2017-10-18 18:18:13 -04:00
ipc merge mozilla-inbound. r=merge a=merge 2017-10-23 23:50:37 +02:00
json
jsurl
locales Backed out changeset c5f2f0e827d0 (bug 1403027) for build bustage at dom/workers/WorkerPrivate.cpp(984): expression did not evaluate to a constant, at least on Windows. r=backout on a CLOSED TREE 2017-10-21 00:31:07 +02:00
manifest Bug 1409191 - Prefetch manifest before install. r=snorp 2017-10-19 00:59:58 +08:00
mathml Bug 1406278: Part 1 - Pass subject principal to SetAttribute and friends. r=bz 2017-10-09 14:33:38 -07:00
media merge mozilla-inbound to mozilla-central. r=merge a=merge 2017-10-24 11:52:35 +02:00
messagechannel Bug 1408333 Get rid of nsIIPCBackgroundChildCreateCallback - part 2 - MessagePort, r=asuth 2017-10-24 12:02:39 +02:00
network Bug 1408333 Get rid of nsIIPCBackgroundChildCreateCallback - part 3 - UDPSocket, r=asuth 2017-10-24 12:02:39 +02:00
notification Bug 870698 - Part 4: Replace Equals("") with EqualsLiteral(""). r=erahm 2017-09-06 01:13:45 -07:00
offline Bug 1401848. Remove NS_IMPL_EVENT_HANDLER and its consumers. r=smaug 2017-09-22 18:07:05 -04:00
payments Bug 1313150 - Remove |weak| parameter from nsIMutableArray methods. r=froydnj 2017-10-21 23:53:02 +09:00
performance Backed out changeset c5f2f0e827d0 (bug 1403027) for build bustage at dom/workers/WorkerPrivate.cpp(984): expression did not evaluate to a constant, at least on Windows. r=backout on a CLOSED TREE 2017-10-21 00:31:07 +02:00
permission
plugins Bug 1411142 Cast enums to int to silence warning about comparing enums of different types r=jld 2017-10-23 23:54:21 -05:00
power
presentation Bug 1313150 - Remove |weak| parameter from nsIMutableArray methods. r=froydnj 2017-10-21 23:53:02 +09:00
promise Bug 1347644 - Baldr: implement ConsumeStreamCallback in browser (r=bkelly) 2017-10-10 14:41:24 -05:00
push Bug 1407838 - Remove the remains of NS_Alloc/NS_Realloc/NS_Free. r=njn 2017-10-12 11:08:44 +09:00
quota Bug 1410142 - use NS_NewLocalFile in dom/; r=baku 2017-10-23 14:22:14 -04:00
res
script Bug 1407056: Part 1 - Provide more consistent principal/origin URL to content policies. r=bz,ckerschb 2017-10-12 15:43:55 -07:00
secureelement
security Bug 1399956 - Disable some mochitests in headless. r=jrmuizel 2017-10-16 16:15:45 -07:00
smil Bug 849593 - Skip samples of active SMIL timed elements when the sample time precedes the current interval; r=dholbert 2017-10-24 13:06:04 +09:00
storage Bug 1404198: Part 2i - Switch to NS_NewTimer* in dom. r=njn 2017-10-15 23:15:40 -07:00
svg Bug 638054 - Remove or fix tests outside JS using watch/unwatch. r=bz,fitzgen 2017-10-24 20:48:14 +02:00
system Bug 1409579 Only define PATH_MAX if it is not already defined. r=jdm 2017-10-17 18:46:22 -05:00
tests Bug 638054 - Remove or fix tests outside JS using watch/unwatch. r=bz,fitzgen 2017-10-24 20:48:14 +02:00
time
u2f Bug 1410428 - Handle stales messages in {WebAuthn,U2F}Manager r=jcj 2017-10-21 11:34:44 +02:00
url Bug 870698 - Part 8: Replace Equals(NS_LITERAL_CSTRING("")) with EqualsLiteral(""). r=erahm 2017-09-06 15:00:31 -07:00
vr merge mozilla-inbound to mozilla-central. r=merge a=merge 2017-10-17 11:45:16 +02:00
webauthn Bug 1410428 - Handle stales messages in {WebAuthn,U2F}Manager r=jcj 2017-10-21 11:34:44 +02:00
webbrowserpersist Bug 1409329 - NS_NewBufferedOutputStream should take the ownership of the outputStream, r=smaug 2017-10-24 14:38:23 +02:00
webidl Backed out changeset 2602e10160a1 (bug 1410482) for leaks in devtools tests. r=backout 2017-10-23 23:02:57 +02:00
workers Backed out changeset dab1c5badddb (bug 1407679) for failing server startup in mochitests on Android. r=backout on a CLOSED TREE 2017-10-24 21:18:26 +02:00
worklet
xbl Backed out 4 changesets (bug 1390694) for failing crash test and in reftest/tests/layout/reftests/xul/mac-tab-toolbar.xul r=backout on a CLOSED TREE. 2017-10-20 14:49:52 +03:00
xhr Bug 1405696 - pass the document encoding to NS_NewURI for XMLHttpRequest; r=bkelly 2017-10-20 20:47:36 -04:00
xml Bug 1407056: Part 1 - Provide more consistent principal/origin URL to content policies. r=bz,ckerschb 2017-10-12 15:43:55 -07:00
xslt Bug 1406819 - Remove various bits of dead code from dom/. r=baku 2017-10-11 10:09:13 +01:00
xul Bug 1313150 - Remove |weak| parameter from nsIMutableArray methods. r=froydnj 2017-10-21 23:53:02 +09:00
jar.mn
moz.build