gecko/layout/base
Brian Birtles 0ee34a442f Bug 1181392 part 5 - Remove use of IsFinishedTransition from AnimationCollection::HasAnimationOfProperty; r=dbaron
AnimationCollection::HasAnimationOfProperty uses IsFinishedTransition to filter
out transitions that should otherwise be ignored. This is used in the following
places:

1. nsLayoutUtils::HasAnimations

   The is only used by nsIFrame::BuildDisplayListForStackingContext to see if
   there are any opacity animations

   For this case, simply returning *current* animations would be sufficient
   (since finished but filling animations should have already filled in the
   display opacity)

2. CommonAnimationManager::GetAnimationsForCompositor

   This should really only return *current* animations--that is, animations that
   are running or scheduled to run. Finished animations never run on the
   compositor. Indeed, only *playing* animations run on the compositor but, as
   we will see in some of the cases below, it is sometimes useful to know that
   an animation *will* run on the compositor in the near future (e.g. so we can
   pre-render content).

   The places where GetAnimationsForCompositor is used are:

   - When building layers to add animations to layers in nsDisplayList--in this
     case we skip any animations that aren't playing so if
     GetAnimationsForCompositor only returned current animations that would be
     more than sufficient.

   - In nsLayoutUtils::HasAnimationsForCompositor. This in turn is used:

     - In ChooseScaleAndSetTransform to see if the transform is being animated
       on the compositor. If so, it calls
       nsLayoutUtils::ComputeSuitableScaleForAnimation (which also calls
       GetAnimationsForCompositor) and passes the result to
       GetMinAndMaxScaleForAnimationProperty which we have already adjusted in
       part 4 of this patch series to only deal with *relevant* animations

       Relevant animations include both current animations and in effect
       animations but we don't run forwards-filling animations on the compositor
       so GetAnimationsForCompositor should NOT return them. Current animations
       should be enough. In fact, playing animations should be enough but we
       might want to pre-render layers at a suitable size during their delay
       phase so returning current animations is probably ok.

     - In nsDisplayListBuilder::MarkOutOfFlowFrameForDisplay to add a fuzz
       factor to the overflow rect for frames undergoing a transform animation
       on the compositor. In this case too current animations should be
       sufficient.

     - In nsDisplayOpacity::NeedsActiveLayer to say "yes" if we are animating
       opacity on the compositor. Presumably in this case it would be good to
       say "yes" if the animation is in the delay phase too (as it currently
       does). After the animation is finished, we should drop the layer, i.e.
       current animations should be sufficient.

     - In nsDisplayTransform::ShouldPrerenderTransformedContent. As with
       nsDisplayOpacity::NeedsActiveLayer, we only need to pre-render
       transformed content for animations that are current.

     - In nsDisplayTransform::GetLayerState. As with
       nsDisplayOpacity::NeedsActiveLayer, we only need to return active here
       for current animations.

     - In nsIFrame::IsTransformed. Here we test the display style to see if
       there is a transform and also check if transform is being animated on the
       compositor. As a result, we really only need HasAnimationsForCompositor
       to return true for animations that are playing--otherwise the display
       style will tell us if we're transformed or not. Returning true for all
       current compositor animations (which is a superset of playing), however,
       should not cause problems (we already return true for even more than
       that).

     - In nsIFrame::HasOpacityInternal which is much the same as
       nsIFrame::IsTransformed and hence current should be fine.

3. AnimationCollection::CanThrottleAnimation

   Here, HasAnimationOfProperty is used when looking for animations that would
   disqualify us from throttling the animation by having an out-of-date layer
   generation or being a transform animation that affects scroll and so requires
   that we do the occasional main thread sample to update scrollbars.

   It would seem like current animations are enough here too. One interesting
   case is where we *had* a compositor animation but it has finished or been
   cancelled. In that case, the animation won't be current and we should not
   throttle the animation since we need to take it off its layer.

   It turns out checking for current animations is still ok in this case too.
   The reasoning is as follows:

   - If the animation is newly-finished, we'll pick that up in
     Animation::CanThrottle and return false then.

   - If the animation is newly-idle then there are two cases:

     If the cancelled animation was the only compositor animation then
     AnimationCollection::CanPerformOnCompositorThread will notice that there
     are no playing compositor animations and return false and
     AnimationCollection::CanThrottleAnimation will never be called.

     If there are other compositor animations running, then
     AnimationCollection::CanThrottleAnimation will still return false because
     whatever cancelled the animation will update the animation generation and
     we'll notice the mismatch between the layer animation generation and the
     animation generation on the collection.

Based on the above analysis it appears that making
AnimationCollection::HasAnimationOfProperty return only current animations (and
simulatneously renaming it to HasCurrentAnimationOfProperty) is safe. Indeed, in
effect, we already do this for transitions but not for animations. This patch
generalizes this behavior to all animations.

This patch also updates test_animations_omta.html since it was incorrectly
testing that a finished opacity animation was still running on the compositor.
Finished animations should not run on the compositor and the changes in this
patch cause that to happen. The reason we don't just update this test to check
for RunningOn.MainThread is that for opacity animations, unlike transform
animations, we can't detect if an opacity on a layer was set by animation or
not. As a result, for opacity animations we typically test the opacity on
either the main thread or compositor in order to allow for the case where an
animation-set opacity is still lingering on the compositor.
2015-08-07 12:29:36 +09:00
..
crashtests Backed out changeset acb7eb7f5ad4 (bug 1176496) for web compat problems 2015-07-15 23:37:22 +09:00
doc Bug 1110039 - Part 2.4 - Add AccessibleCaretEventHub. r=roc 2015-05-03 23:37:00 +02:00
gtest Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
tests Bug 1188665 - Make nsIDOMWindowUtils.disableDialogs() disable onbeforeunload dialogs. r=bz 2015-07-31 16:13:01 -07:00
AccessibleCaret.cpp Bug 1161392 - Enlarge touch area for AccessibleCaret. r=roc 2015-05-27 16:37:28 +08:00
AccessibleCaret.h Bug 1188696 - Hoist nsRefPtr.h into MFBT. r=froydnj 2015-07-29 10:44:59 -07:00
AccessibleCaretEventHub.cpp Bug 1189353 - Change NS_ macro prefix to MOZ_ in AccessibleCaretEventHub. r=mtseng 2015-07-30 08:07:00 -04:00
AccessibleCaretEventHub.h Bug 1189353 - Change NS_ macro prefix to MOZ_ in AccessibleCaretEventHub. r=mtseng 2015-07-30 08:07:00 -04:00
AccessibleCaretLogger.cpp Bug 1163907 - Remove #ifdef PR_LOGGING in AccessibleCaretLogger 2015-05-11 23:05:00 +08:00
AccessibleCaretLogger.h Bug 1165515 - Part 13-2: Replace usage of PRLogModuleLevel and PR_LOG_*. rs=froydnj 2015-06-03 15:25:57 -07:00
AccessibleCaretManager.cpp Bug 1181418 - Send selectionEditable info to app_text_selection_dialog. r=tlin, r=kanru, sr=smaug 2015-07-31 04:34:00 +08:00
AccessibleCaretManager.h Bug 1188696 - Hoist nsRefPtr.h into MFBT. r=froydnj 2015-07-29 10:44:59 -07:00
ActiveLayerTracker.cpp Bug 1181240 - Part 2: Replace gfx3DMatrix with Matrix4x4 in layout,r=vlad 2015-07-10 17:05:47 -07:00
ActiveLayerTracker.h Bug 1151359 (Part 3) - Treat nsImageFrames subject to scale animation as having an identity scale when predicting size. r=tn,birtles 2015-07-19 19:30:40 -07:00
CaretAssociationHint.h Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
DisplayItemClip.cpp Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
DisplayItemClip.h Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
DisplayListClipState.cpp Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
DisplayListClipState.h Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
FrameLayerBuilder.cpp Bug 1187619 - Only optmimize FrameLayerBuilder visibility calculations if correct. r=mattwoodrow 2015-08-03 04:07:00 -04:00
FrameLayerBuilder.h Bug 1187619 - Only optmimize FrameLayerBuilder visibility calculations if correct. r=mattwoodrow 2015-08-03 04:07:00 -04:00
FramePropertyTable.cpp Bug 1182963 - Use nsTHashTable::Iterator in FramePropertyTable. r=njn 2015-07-15 17:05:06 +08:00
FramePropertyTable.h Bug 1188745 - Rename nsTArray::SizeOfExcludingThis() as ShallowSizeOfExcludingThis(). r=froydnj. 2015-07-28 23:24:24 -07:00
GeometryUtils.cpp Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
GeometryUtils.h Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
LayerState.h Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
LayoutLogging.cpp Bug 1175289 - Part 1: Add LAYOUT_WARNING. r=mats 2015-06-16 16:37:14 -07:00
LayoutLogging.h Bug 1175289 - Part 1: Add LAYOUT_WARNING. r=mats 2015-06-16 16:37:14 -07:00
MaskLayerImageCache.cpp Bug 1182963 - Use nsTHashTable::Iterator in MaskLayerImageCache. r=njn 2015-07-15 17:05:06 +08:00
MaskLayerImageCache.h Bug 1182963 - Use nsTHashTable::Iterator in MaskLayerImageCache. r=njn 2015-07-15 17:05:06 +08:00
MobileViewportManager.cpp Bug 1188172 - Don't update the resolution/SPCSPS for meta-viewport changes before the first-paint. r=botond 2015-08-02 22:50:54 -04:00
MobileViewportManager.h Bug 1188172 - Don't update the resolution/SPCSPS for meta-viewport changes before the first-paint. r=botond 2015-08-02 22:50:54 -04:00
moz.build Bug 1189224 - Add BUG_COMPONENT for AccessibleCaret and others to moz.build. r=roc 2015-07-30 02:33:00 -04:00
nsArenaMemoryStats.h Bug 1168299 - Break out style struct memory usage reporting from pres-shell. r=njn 2015-05-27 12:08:42 +10:00
nsAutoLayoutPhase.cpp
nsAutoLayoutPhase.h
nsBidi.cpp Bug 1173415 - Fix incorrect mask used for nsBidi::mFlags [r=smontagu] 2015-06-11 10:10:48 -07:00
nsBidi.h Bug 1157726: Updated algorithm to match ICU implementation of support for bidi isolates. r=smontagu 2015-04-28 22:41:44 -04:00
nsBidiPresUtils.cpp Bug 1177505 - Make all continuations fluid within non-bidi paragraphs. r=smontagu 2015-07-30 13:47:08 -07:00
nsBidiPresUtils.h Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
nsCaret.cpp Bug 1164693 - Part 1: Directional caret should point in caret direction in bidi paragraphs. r=smontagu 2015-06-05 21:44:54 -04:00
nsCaret.h Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
nsChangeHint.h Bug 1180118 - Part 2: Add eRestyle_SomeDescendants restyle hint and pass associated restyle hint data into restyle methods. r=bzbarsky 2015-08-05 22:42:20 +10:00
nsCompatibility.h
nsCounterManager.cpp
nsCounterManager.h
nsCSSColorUtils.cpp
nsCSSColorUtils.h
nsCSSFrameConstructor.cpp Bug 1177819. Replace the warning about anon content being passed into frame construction with an assert plus whitelisting of the known-OK cases. r=dholbert 2015-07-23 11:51:09 -04:00
nsCSSFrameConstructor.h Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
nsCSSRendering.cpp Bug 1185636 - Part 4b - don't use a css border skirt when printing. r=mstange 2015-07-31 14:09:29 -04:00
nsCSSRendering.h Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
nsCSSRenderingBorders.cpp Bug 1185636 - Part 4 - Implement CSS border corners by splitting geometry instead of gradients with hard stops. r=mstange 2015-07-31 14:27:19 -04:00
nsCSSRenderingBorders.h Bug 1185636 - Part 4 - Implement CSS border corners by splitting geometry instead of gradients with hard stops. r=mstange 2015-07-31 14:27:19 -04:00
nsDisplayItemTypes.h
nsDisplayItemTypesList.h
nsDisplayList.cpp Bug 1181976 - Rename WillChangeBudgetWarning in dom/dom.properties to reflect string change. r=flod 2015-07-23 11:54:45 -04:00
nsDisplayList.h Bug 1181240 - Part 2: Replace gfx3DMatrix with Matrix4x4 in layout,r=vlad 2015-07-10 17:05:47 -07:00
nsDisplayListInvalidation.cpp Bug 1175217 - Fix non-unified (and some unified) builds for nsDisplayListInvalidation.cpp. r=mstange 2015-06-16 15:16:30 -04:00
nsDisplayListInvalidation.h Bug 1157951 patch 1 - Rename fields and variables in nsCharClipDisplayItem etc using VisIStart/End instead of left/right. r=roc 2015-04-29 08:18:53 +01:00
nsDocumentViewer.cpp Bug 1191100 - Remove XPIDL signature comments in .cpp files. r=ehsan 2015-08-04 16:17:36 -07:00
nsFrameManager.cpp Bug 1174631 (part 4) - Replace nsFrameManager's uses of PL_DHashTableEnumerate() with PLDHashTable::Iterator. r=dholbert. 2015-06-16 21:09:39 -07:00
nsFrameManager.h
nsFrameManagerBase.h Bug 1170416 (part 3) - Remove the PLDHashTable2 typedef. r=froydnj. 2015-05-19 16:46:17 -07:00
nsFrameTraversal.cpp Bug 1132518, add a flag to nsIFrameTraversal to skip the popup checks, r=mats 2015-07-13 06:07:49 -04:00
nsFrameTraversal.h Bug 1132518, add a flag to nsIFrameTraversal to skip the popup checks, r=mats 2015-07-13 06:07:49 -04:00
nsGenConList.cpp
nsGenConList.h
nsIDocumentViewerPrint.h
nsIFrameTraversal.h Bug 1132518, add a flag to nsIFrameTraversal to skip the popup checks, r=mats 2015-07-13 06:07:49 -04:00
nsILayoutDebugger.h
nsILayoutHistoryState.h
nsIPercentBSizeObserver.h Bug 1174711 - patch 1 - Rename nsIPercentHeightObserver to nsIPercentBSizeObserver, and update related frame methods to match. r=dholbert 2015-06-22 10:33:34 +01:00
nsIPresShell.h Bug 1178847 - Add a MobileViewportManager to manage setting the CSS viewport on B2G. r=botond,tn 2015-07-21 10:51:55 -04:00
nsIReflowCallback.h
nsIStyleSheetService.idl
nsLayoutDebugger.cpp Bug 1061393 - Export display list info to layer scope viewer. r=kamidphish 2015-08-03 02:11:00 -04:00
nsLayoutHistoryState.cpp
nsLayoutUtils.cpp Bug 1181392 part 5 - Remove use of IsFinishedTransition from AnimationCollection::HasAnimationOfProperty; r=dbaron 2015-08-07 12:29:36 +09:00
nsLayoutUtils.h Bug 1181392 part 5 - Remove use of IsFinishedTransition from AnimationCollection::HasAnimationOfProperty; r=dbaron 2015-08-07 12:29:36 +09:00
nsPresArena.cpp Bug 1182963 - Use nsTHashTable::Iterator in nsPresArena. r=njn 2015-07-15 17:05:06 +08:00
nsPresArena.h Bug 1188745 - Rename nsTArray::SizeOfExcludingThis() as ShallowSizeOfExcludingThis(). r=froydnj. 2015-07-28 23:24:24 -07:00
nsPresContext.cpp Bug 1180125 part 1b - Hook nsAnimationManager's list of events up to the cycle collector; r=dbaron 2015-07-29 10:57:39 +09:00
nsPresContext.h Bug 1183786 - Part 3: Make nsPresContext helper-function return already_AddRefed instead of bool+outparam. r=tn 2015-08-03 17:13:07 -07:00
nsPresShell.cpp Bug 1180125 part 7 - Queue transition events from CSSTransition::Tick; r=dbaron 2015-07-29 10:57:40 +09:00
nsPresShell.h Bug 1178354 - Ensure we fire a before-first-paint event for printing as well. r=tn 2015-07-23 17:53:32 -04:00
nsPresState.h
nsQuoteList.cpp
nsQuoteList.h
nsRefreshDriver.cpp Bug 1180125 part 8 - Dispatch transition events from refresh driver; r=dbaron 2015-07-29 10:57:40 +09:00
nsRefreshDriver.h Bug 1180125 part 1 - Queue and dispatch CSS animation events as a separate step; r=dbaron 2015-07-29 10:57:39 +09:00
nsStyleChangeList.cpp
nsStyleChangeList.h
nsStyleSheetService.cpp Bug 905127 - Part 1 - Make some functions from nsNetUtil not inline. r=jduell 2015-07-07 04:17:00 +02:00
nsStyleSheetService.h
PaintTracker.cpp
PaintTracker.h
PositionedEventTargeting.cpp Bug 1188185 - Zoomed View appears when the two links are the same link. r=kats 2015-07-31 15:22:46 +02:00
PositionedEventTargeting.h Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
RestyleLogging.h
RestyleManager.cpp Bug 1180125 part 2 - Move AnimationCommon classes out of CSS namespace; r=dbaron 2015-07-29 10:57:39 +09:00
RestyleManager.h Bug 1180118 - Part 11: Use ReparentStyleContext even if eRestyle_SomeDescendants is used. r=bzbarsky 2015-08-05 22:42:21 +10:00
RestyleTracker.cpp Bug 1180118 - Part 9: Clear nsCSSSelector pointers in the pending restyle tracker if they might be stale. r=bzbarsky 2015-08-05 22:42:21 +10:00
RestyleTracker.h Bug 1180118 - Part 9: Clear nsCSSSelector pointers in the pending restyle tracker if they might be stale. r=bzbarsky 2015-08-05 22:42:21 +10:00
RestyleTrackerInlines.h
ScrollbarStyles.cpp Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
ScrollbarStyles.h Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
SelectionCarets.cpp Use widgets for APZ checks, rather than gfxPrefs. (bug 1162064, r=kats,mstange) 2015-06-04 16:51:10 -04:00
SelectionCarets.h Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
StackArena.cpp
StackArena.h
TouchCaret.cpp Bug 1165515 - Part 13-2: Replace usage of PRLogModuleLevel and PR_LOG_*. rs=froydnj 2015-06-03 15:25:57 -07:00
TouchCaret.h Bug 988143 - Enable Gecko Touch in Fennec, TouchCaret Scroll mods, r=ehsan 2015-05-14 22:06:13 -04:00
TouchManager.cpp
TouchManager.h
Units.h Bug 1189837 - Subtract scrollbars in LD pixels rather than CSS pixels. r=mstange 2015-08-05 14:39:42 -04:00
UnitTransforms.h Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
WordMovementType.h Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
ZoomConstraintsClient.cpp Bug 1186004 - Add a pref to enable/disable APZ zooming behaviour. r=botond 2015-07-22 23:42:08 -04:00
ZoomConstraintsClient.h Bug 1055557 - Add a ZoomConstraintsClient class to manage pushing zoom constraints updates to the APZ code. r=botond 2015-06-17 12:32:42 -04:00