Commit Graph

22 Commits

Author SHA1 Message Date
Andrew McCreight
aeff7c99ee Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
Brian Birtles
28a48770ea Bug 1152171 part 2 - Rename AnimationTimeline to DocumentTimeline; r=smaug
And then re-add AnimationTimeline as an abstract super-interface of
DocumentTimeline.
2015-04-10 10:34:22 +09:00
Ehsan Akhgari
33bb32f549 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00
Boris Zbarsky
54c64f20a9 Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp.  The
rest of this diff was generated by running the following commands:

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 10:13:33 -04:00
Jonathan Watt
636fdf8aef Bug 1105098 - Make AnimationTimeline always return the same parent object (even after document.open()) and replace the document's timeline if the document is reset. r=smaug,birtles 2015-01-26 17:08:51 +00:00
Brian Birtles
9aa9876849 Bug 1112480 part 8 - Remove AnimationTimeline::FastForward; r=jwatt
Now that we don't actually start pending animations until the following refresh
driver tick we no longer need to be able to fast-forward the AnimationTimeline
between ticks.
2015-01-09 07:57:58 +09:00
Brian Birtles
c6c61dd8ec Bug 1112480 part 5 - Add AnimationTimeline::IsUnderTestControl; r=jwatt
Earlier in this patch series we added AnimationPlayer::StartOnNextTick which
takes a ready time parameter expressed in timeline time. In order to call this
method when painting finishes we need to convert the TimeStamp recorded when
painting finished to a timeline time. However, when the timeline is driven by
a refresh driver under test control we can no longer meaningfully do this
conversion since there is no correspondence between the notion of time used to
record the time when painting finished (wallclock time) and the notion of time
used by the timeline (which has been arbitrarily adjusted by test code).

We need a way to detect this situation so that we know not to call
ToTimelineTime in that case.

Alternatively, we could make ToTimelineTime automatically return a null value
when its refresh driver is under test control. However, in this situation
ToTimelineTime can still actually be used to convert a TimeStamp to a timeline
time as long as the TimeStamp is from the same refresh driver. Indeed,
GetCurrentTime does exactly that. So if we were to go down that route we would
have to provide a way for GetCurrentTime to work around that restriction.

For now, this patch puts the onus on the caller of ToTimelineTime to check if
the timeline is under test control first (unless they are passing a TimeStamp
from the same refresh driver, in which case there is no need to check).
2015-01-09 07:57:58 +09:00
Brian Birtles
85de6d4ee1 Bug 927349 part 19 - Don't add pending animations to layers when their refresh driver is under test control; r=jwatt 2014-12-22 09:35:42 +09:00
Brian Birtles
145bc92aff Bug 927349 part 8 - Fast-forward the timeline before resolving start times; r=jwatt
Normally animation players get times from their timeline which is based on the
refresh driver for their associated document. However, for animations that
we time from when their first frame has been rendered, we want to record the
actual time when painting finished as their start time. If we wait until the
next refresh driver tick then the delay between playing an animation and its
actual start will be too great.

In this patch, we introduce a mechanism for fast-forwarding a timeline to a
time between the current refresh driver time and the next refresh driver tick.
By adjusting the timeline rather than the player we maintain a consistent state
(in fact, if we just naively set the animation player start time to the
timestamp value we recorded when painting finished it will appear to start in
the future and the animation will temporarily jump from playing, to waiting to
start, then back to playing again on the next refresh driver tick).

To be completely consistent, however, when we fast-forward the timeline we
should tell all animation players listening to the timeline to mark their
target element as needing a style flush. Otherwise we may be able to observe an
inconsistency between some animation players' current time and the computed
style of their targets.

We don't, however, currently know which players are observing a given timeline.
We will likely introduce that in the near future (in order to implement
AnimationTimeline.getAnimationPlayers) and fix the inconsistency in timing then.
A test later in the patch series verifies this inconsistency so it is easy to
fix in future.

An alternative approach would be to simply record the time when animation should
start, send that time to the compositor but don't actually update the animation
start time on the main thread until the subsequent refresh driver tick. Such
an approach is complex as it introduces an additional state--"finished pending
but not yet started". We will attempt to switch to that approach in bug 1112480.
2014-12-22 09:35:41 +09:00
Brian Birtles
bb3b4e4dde Bug 927349 part 7 - Factor out AnimationTimeline::GetRefreshDriver into a separate method; r=jwatt
This is in preparation for adding AnimationTimeline::FastForward in the next
patch which will reuse this code.
2014-12-18 08:42:41 +09:00
Brian Birtles
08f14db851 Bug 1104435 part 1 - Make AnimationTimeline::GetParentObject return an nsIGlobalObject; r=smaug
In order to create a Promise object for AnimationPlayer.ready, we need an
nsIGlobalObject. Currently we can access this through the following chain:

  AnimationPlayer -> AnimationTimeline -> Document -> nsIGlobalObject

Come bug 1096776 (Support AnimationPlayers without a timeline or with an
inactive timeline) we will no longer be able to rely on having an
AnimationTimeline so we will probably have to store the corresponding window
object on the AnimationPlayer. For now, however, we can look up the timeline as
above.

This patch makes this a little more straightforward by changing the return type
and value of AnimationTimeline::GetParentObject to return the nsIGlobalObject of
the document with which it is associated.
2014-12-18 08:42:40 +09:00
Brian Birtles
3727776b2f Bug 1078119 - Rename AnimationTimeline/AnimationPlayer GetCurrentTimeDuration; r=bz
This patch performs the following renaming:

  AnimationPlayer::GetCurrentTime -> GetCurrentTimeAsDouble
  AnimationPlayer::GetCurrentTimeDuration -> GetCurrentTime
  AnimationTimeline::GetCurrentTime -> GetCurrentTimeAsDouble
  AnimationTimeline::GetCurrentTimeDuration -> GetCurrentTime
2014-10-20 13:55:45 +09:00
Peter Van der Beken
9254096129 Bug 1078744 - Replace SetIsDOMBinding with SetIsNonDOMBinding, remove nsWrapperCache::SetIsDOMBinding. r=bz.
--HG--
extra : rebase_source : 89c476cd9436530b2df5acc903909e34188417a0
2014-10-07 11:44:49 +02:00
David Zbarsky
447962fe79 Bug 1033114 Part 4: Make mStartTime a nullable TimeDuration r=birtles 2014-08-30 02:11:57 -04:00
David Zbarsky
7276fd8572 Bug 1033114 Part 3: Make mStartTime a nullable TimeDuration r=birtles 2014-08-30 02:11:57 -04:00
Ehsan Akhgari
3925065702 Bug 1050611 - Fix more bad implicit constructors in dom and docshell; r=smaug 2014-08-08 09:49:39 -04:00
Brian Birtles
532c1e8eff Bug 1002332 - Make AnimationTimeline record the last refresh time and use that when there is no refresh driver; r=bz
A document that belongs to an iframe that is display:none as no associated pres
context from which to get a refresh driver. However, in this case
document.timeline.currentTime should still never go backwards (since document
timelines are supposed to be monotonically increasing).

This patch makes AnimationTimeline record the last value returned for the
current time so that if the document becomes display:none we can still return
the most recently used time.
2014-07-24 13:37:38 +09:00
Brian Birtles
10fd3a5994 Bug 1032573 part 4 - Add AnimationTimeline::ToTimelineTime helper method; r=dbaron
This patch simply factors out the conversion from a TimeStamp value to
a nullable-double value relative to the start of the timeline. This is so that,
in a subsequent patch, this functionality can be reused by ElementAnimation
when it reports its start time (which is currently recorded as a TimeStamp).
2014-07-16 09:02:30 +09:00
Brian Birtles
320ac1d2de Bug 1032573 part 3 - Add AnimationTimeline::GetCurrentTimeStamp; r=dbaron
AnimationTimeline::GetCurrentTime returns the time value of the timeline as
a double. For internal calculations however it is more useful to get this as
a mozilla::TimeStamp.

This patch splits the calculation of the current time into two stages:
calculation as a timestamp then conversion to a double.
2014-07-16 09:02:30 +09:00
Benoit Jacob
747dcfc8a0 Bug 1028588 - Fix dangerous public destructors in the rest of dom/ - r=ehsan 2014-06-23 15:56:07 -04:00
Brian Birtles
8343e66e73 Bug 998246 part 4 - Add currentTime member to AnimationTimeline; r=bz 2014-05-13 16:22:12 +09:00
Brian Birtles
bc16925f39 Bug 998246 part 2 - Add AnimationTimeline interface; r=bz, r=glandium 2014-05-13 16:22:12 +09:00