Commit Graph

256729 Commits

Author SHA1 Message Date
Brian Birtles
97abad403c Bug 1181392 part 10 - Remove KeyframeEffect::IsFinishedTransition; r=dbaron 2015-08-07 12:29:36 +09:00
Brian Birtles
bd4222b60e Bug 1181392 part 9 - Remove use of IsFinishedTransition from nsTransitionManager::FlushTransitions; r=dbaron
This patch updates the logic in nsTransitionManager::FlushTransitions that deals
with detecting newly-started (i.e. when the delay phase has just finished) or
newly-finished animations. The existing logic had the following behavior:

* Calling SetIsFinishedTransition for newly-finished transitions.
  This is no longer needed since by this point all consumers of
  IsFinishedTransition have been updated to use alternative means for testing
  if an animation is relevant.

* Setting transitionStartedOrEnded to true so that we would post an animation
  restyle.
  We can achieve this same effect by simplying updating the canThrottleTick
  flag using the result of calling Animation::CanThrottle on each animation.
  Animation::CanThrottle will return false for a newly-started or
  newly-finished animation (it returns false for a newly-started animation
  since the animation's mIsRunningOnCompositor flag won't yet be true at that
  point.)

* Updating the animation generation for newly-started and newly-finished
  animations in order to trigger a layer update.
  At least that appears to be the intention of this code. However, it currently
  has no effect since the animation generation on the pres context is not
  incremented in any context I could find where a newly started/finished
  animation might be detected.

For this third case, this patch adds tests to ensure that transitions are
correctly added and removed from the compositor when they start and finish.
This is because most of the existing tests in test_animations_omta.html cover
only CSS animations.

As noted in the comments in the test, if a tick lands at the exact beginning of
a transition we will typically not send it to the layer until the following tick
because the RestyleManager will filter out the seemingly redundant change (i.e.
no change to the computed style). Presumably updating the animation generation
was intended to avoid this.

This same behavior is true of CSS animations (and the same kind of comment
appears elsewhere in test_animations_omta.html). Long-term this is probably
worth fixing so that when a transition is triggered we get it to the compositor
one tick earlier which should improve responsiveness when the main thread is
busy and the interval between ticks is long. Furthermore, we should do the same
for both all type of animations, not just transitions.

Currently, however, this patch preserves the existing behavior and helps narrow
the difference between transitions and animations so we can apply this
optimization to both.
2015-08-07 12:29:36 +09:00
Brian Birtles
db21de2dff Bug 1181392 part 8 - Remove use of IsFinishedTransition from nsTransitionManager::PruneCompletedTransitions; r=dbaron
This patch generalizes the logic in
nsTransitionManager::PruneCompletedTransitions to consider all transitions that
are no longer current (i.e. not running or scheduled to run) rather than
those marked as finished.
2015-08-07 12:29:36 +09:00
Brian Birtles
20281f56f4 Bug 1181392 part 7 - Remove use of IsFinishedTransition from nsTransitionManager::ConsiderStartingTransition; r=dbaron
Of particular note, this patch removes the check for finished transitions in
the case when we can't animate the current change. This case occurs when either
we have a non-transition style change that happens to coincide with the current
transition value, or a style change to something we can't interpolate to. In
either case it's not clear why we would cancel the existing transition only if
it is still in motion and not if it is finished. It seems like it should be
cancelled in either case and hence this patch removes this check.

The other change relates to detecting reversing transitions. In this case we do
need to distinguish between transitions that have finished and those that have
not. For this purpose, checking if the animation is current should be
sufficient. (Note that comparing for PlayState() == Finished would not be enough
since we want to also exclude *idle*, i.e. cancelled, animations too.)
2015-08-07 12:29:36 +09:00
Brian Birtles
ada993ef5a Bug 1181392 part 6 - Remove use of IsFinishedTransition from nsTransitionManager::StyleContextChanged; r=dbaron
In StyleContextChanged, when we drop a transition, we also update the animation
generation, unless the transition is finished. This is so that we will update
animations on layers accordingly. For all intents and purposes this is
equivalent to only updating the animation generation if the animation is
current.

Even in the case where the transition has *just* finished, it will either
already be considered finished and the regular animation tick (which uses the
same refresh driver time as we see in StyleContextChanged) will have triggered
an unthrottled sample to take the animation off the compositor (since
Animation::CanThrottle detects newly finished animations), or it will be not yet
finished in which case HasCurrentEffect will return true. If anything changed
timing properties in the time between running the refresh driver tick and
calling StyleContextChanged (such as seeking the Animation) it will also trigger
a layer update.

This patch also removes an unncessary assertion in
ElementPropertyTransition::CurrentValuePortion. This functions operates
sensibly even for finished transitions (due to the way it manages the fill
mode). It is up to the call site to determine whether it should be calling this
function on a finished transition or not.
2015-08-07 12:29:36 +09:00
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
Brian Birtles
e06c970271 Bug 1181392 part 4 - Remove use of IsFinishedTransition from nsLayoutUtils; r=dbaron
GetMinAndMaxScaleForAnimationProperty in nsLayoutUtils uses IsFinishedTransition
to ignore finished transitions since they should not have any effect on current
or future scale values. We can generalize this, however, and say we are only
interested in animations that are *either*:

a) running or scheduled to run in the future, i.e. "current", OR
b) applying a value, including a finished animation with a forwards fill,
   i.e. "in effect"

Elsewhere, animations that fulfil *either* of this conditions are referred to as
"relevant animations" so we can simply test for relevance in this function.
2015-08-07 12:29:36 +09:00
Brian Birtles
b012191a8b Bug 1181392 part 3 - Remove use of IsFinishedTransition in KeyframeEffectReadOnly; r=dbaron
KeyframeEffectReadOnly uses IsFinishedTransition to exclude finished transitions
from certain tests. This check, however, is redundant in each case.
This is because any effect marked as IsFinishedTransition will have the
following properties:
- owning animation's PlayState() == Finished or Idle
- animation phase = after or null
- progress = null (this is because transitions don't fill forwards)
2015-08-07 12:29:35 +09:00
Brian Birtles
38ae5427a9 Bug 1181392 part 2 - Remove use of IsFinishedTransition from Animation::ComposeStyle; r=dbaron
Animation::ComposeStyle uses IsFinishedTransition to skip doing work for
transitions that have run their course. We can, however, generalize this to
cover all animations that are not currently contributing to the animated
style--that is animations that are not "in effect".

We need to add this check *after* we update aNeedsRefreshes since an animation
that is not "in effect" because it has a delay and no backwards fill (in this
case it will have a play state of "running") still needs refreshes.
2015-08-07 12:29:35 +09:00
Brian Birtles
63d9e72949 Bug 1181392 part 1 - Remove use of IsFinishedTransition from Animation::CanThrottle; r=dbaron
Previously we used IsFinishedTransition so that if the only animations present
are finished transitions we could throttle the tick. In fact, this probably
shouldn't even be necessary since we shouldn't be calling CanThrottle if
AnimationCollection::mNeedsRefreshes is false. However, so long as we're
performing this test it turns out we can generalize this further and throttle
ticks for all finished animations that are not newly finished, regardless of
whether they are running on the compositor or not (although this method won't
be called unless the animation property could be run on the compositor anyway).

This method is somewhat confusing. For one, it is not strictly limited to
animations that are running on the compositor. It appears to only return true
when the animation is running on the compositor but the mIsRunningOnCompositor
flag doesn't get cleared when the animation finishes (bug 1151694). As a result
this method also deals with animations that are now running on the main thread.
This patch makes us deal with such animations more consistently.

This patch also reworks this method so that it's hopefully a little easier to
follow and a little more consistent since I spent several hours trying to
understand the different combinations of inputs this method could take and what
question it was trying to answer.
2015-08-07 12:29:35 +09:00
Nicholas Nethercote
6a0cbc501c Bug 1190735 - Remove nsITimer.TYPE_REPEATING_PRECISE. r=froydnj. 2015-08-04 17:30:53 -07:00
Ehsan Akhgari
e6624b492b Bug 1191959 - Make sure that pinned tabs are still clickable after unuting a tab that is not playing; r=jaws
This bug happens becuase when toggleMuteAudio() is called from the click
handler for the tab, we remove the muted attribute during unmuting,
which makes the element display:none.  Therefore, when the mouse pointer
leaves that region, there is no element to receive the mouseout event
and as a result, the _overPlayingIcon variable stays true, which means
we stop tab switching in the mousedown handler.
2015-08-06 23:09:11 -04:00
JW Wang
df0b9f9e11 Bug 1191173 - Mirror MediaDecoder::mSameOriginMedia in MDSM. r=jya. 2015-08-06 18:05:30 +08:00
Jean-Yves Avenard
6174d6cdb9 Bug 1188131: Don't rely on MediaResource type to detect media format. r=cpearce
This information is often wrong and non-existent with MSE. Let the PDM decides later based on the metadata.
This prevent hardware acceleration to be turned on leading to extremely high CPU usage on high definition videos.
2015-08-07 12:19:49 +10:00
Nicholas Nethercote
240a396df0 Bug 1191670 - Tweak comments in some memory reporter tests. r=erahm.
DONTBUILD because comment-only changes.
2015-08-06 19:07:50 -07:00
Wes Kocher
3afc623785 Merge m-c to inbound, a=merge 2015-08-06 18:42:15 -07:00
Wes Kocher
59bac929e6 Backed out changeset fdf5862a8c00 (bug 1176451) a=backout 2015-08-06 18:38:22 -07:00
Ben Kelly
ab6a144621 Bug 983301 Add a test for FetchEvent.respondWith(5). r=bz 2015-08-06 18:12:14 -07:00
Wes Kocher
82841444d6 Merge m-c to inbound, a=merge 2015-08-06 18:11:16 -07:00
Nathan Froyd
481fadc1ee Bug 1192070 - avoid complaining about missing override keywords in skia; r=glandium 2015-08-07 01:34:57 -04:00
Wes Kocher
286607c91f Merge b2ginbound to central, a=merge 2015-08-06 18:09:39 -07:00
Nathan Froyd
380dd1729b Bug 1191900 - remove superfluous check for GCC force_align_arg_pointer attribute; r=glandium
qcms and libav use __attribute__((force_align_arg_pointer))
unconditionally; the libav use case suggests that the attribute has been
around since GCC 4.2.  We're well past that point with GCC, and clang
supports it also.  So we can simply assume the compiler has it in the
appropriate places.

It is, however, x86 only (x86-64 appropriately aligns the stack at all
times), so we need to adjust the libpixman build code appropriately.
2015-08-06 21:07:57 -04:00
Nathan Froyd
e46a140f9e Bug 1191884 - remove now-unnecessary check for GCC PR49911; r=glandium
This PR was fixed in the GCC 4.7 development cycle.  Since we require
GCC 4.7 now, we no longer have to check for this bug.
2015-08-06 20:41:38 -04:00
David Anderson
edce567d24 Remove the backend flag to TextureClient::CreateForDrawing. (bug 1183910 part 9, r=mattwoodrow) 2015-08-06 17:27:36 -07:00
Ehsan Akhgari
76d464ab5c Bug 1191081 - Part 2: Make the crashed overlay icon for pinned tabs take priority over the muted overlay icon; r=jaws 2015-08-06 20:21:56 -04:00
Nick Thomas
a712aac8f6 Bug 1174011, fix xulrunner-stub compile, r=gladium DONTBUILD 2015-08-07 12:20:28 +12:00
Nicholas Nethercote
fbbc12d6a6 Backout bff74cecc67c, ffe0edb2aae7, b60b7c267cef, 6da154b43265, bcf6fd3ab9bb (bug 1182961 parts 1--5) for possible intermittent failures and performance problems.
a=bustage
2015-08-06 16:30:47 -07:00
Nicholas Nethercote
88210c43e1 Backout 04a196339ca4 (bug 1181443, part 3) so that bug 1182961's patches can be backed out. 2015-08-06 16:28:13 -07:00
Brian Grinstead
222dac4517 Backed out changeset 657bc9b41d71 (bug 1175702) 2015-08-06 17:00:31 -07:00
Brian Grinstead
487c416a88 Backed out changeset dc33bb49347d (bug 1175702) 2015-08-06 17:00:16 -07:00
Brian Grinstead
0f9cbe241f Backed out changeset 7216b345380e (bug 1175702) 2015-08-06 16:59:56 -07:00
B2G Bumper Bot
f596dfb3bc Bumping manifests a=b2g-bump 2015-08-06 15:27:04 -07:00
B2G Bumper Bot
34a0b905a7 Bumping gaia.json for 1 gaia revision(s) a=gaia-bump
========

https://hg.mozilla.org/integration/gaia-central/rev/ab36b7edaadc
Author: Wes Kocher <kwierso@gmail.com>
Desc: Revert "Merge pull request #31203 from zbraniecki/1187668-settings-l10n-downloads" for download_formatter_test.js failures

This reverts commit f33da62d93ef341a5dbd7e60bfe160495df3dc1d, reversing
changes made to 682419bda6501c3d84ef116c9c51530eee99dbf6.
2015-08-06 15:25:25 -07:00
B2G Bumper Bot
7d91886bed Bumping manifests a=b2g-bump 2015-08-06 13:47:51 -07:00
B2G Bumper Bot
9b264c5d16 Bumping gaia.json for 2 gaia revision(s) a=gaia-bump
========

https://hg.mozilla.org/integration/gaia-central/rev/0fde69e039cb
Author: Zibi Braniecki <zbigniew.braniecki@gmail.com>
Desc: Merge pull request #31203 from zbraniecki/1187668-settings-l10n-downloads

Bug 1187668 - update settings/downloads l10n api uses. r=evelyn, gasolin

========

https://hg.mozilla.org/integration/gaia-central/rev/4d4ca8432b6f
Author: Zibi Braniecki <gandalf@mozilla.com>
Desc: Bug 1187668 - update settings/downloads l10n api uses.
2015-08-06 13:46:54 -07:00
Ryan VanderMeulen
68755aa21d Merge m-c to fx-team. a=merge 2015-08-06 15:53:46 -04:00
Ryan VanderMeulen
e6c856afa4 Merge b2g-inbound to m-c. a=merge 2015-08-06 15:37:49 -04:00
Ryan VanderMeulen
d03555f46c Merge inbound to m-c. a=merge 2015-08-06 15:22:37 -04:00
Ryan VanderMeulen
ecc3a89ec1 Backed out changeset 2f16fb18314a (bug 1181908) for suspicion of causing bug 1191492 and other topcrashes. a=me 2015-08-06 13:28:32 -04:00
Kit Cambridge
10756f04d7 Back out changeset 0e68d7a16ed8 (bug 1189543) for mochitest-push timeouts. 2015-08-06 10:12:59 -07:00
Jonathan Kew
1e161f8aaa Backout changesets 1639af64e372, 74ecf0f57a56, 94831690f525, 27eab13d3cf2 (bug 1183431) for Android-specific failure in reftest 1183431-orthogonal-modes-5a.html. 2015-08-06 17:32:20 +01:00
Ryan VanderMeulen
bddf09f679 Backed out changeset 58f71d9d0de7 (bug 1191579) for various webapp/webide test failures across different suites. 2015-08-06 12:25:54 -04:00
Kyle Machulis
9818c59749 Bug 1186582 - AskPermission should check for prompt exceptions; r=fabrice 2015-08-06 08:53:23 -07:00
B2G Bumper Bot
15d3f22d2d Bumping manifests a=b2g-bump 2015-08-06 08:52:14 -07:00
B2G Bumper Bot
672c68e981 Bumping gaia.json for 5 gaia revision(s) a=gaia-bump
========

https://hg.mozilla.org/integration/gaia-central/rev/16423131f4a9
Author: Kevin Grandon <kevingrandon@yahoo.com>
Desc: Merge pull request #31063 from KevinGrandon/bug_1186279_ringtones_switches

Bug 1186279 - Convert ringtones switches to use web components

========

https://hg.mozilla.org/integration/gaia-central/rev/face06c73022
Author: Kevin Grandon <kevingrandon@yahoo.com>
Desc: Bug 1186279 - Use gaia theme label-color variable for component labels

========

https://hg.mozilla.org/integration/gaia-central/rev/cf78c443c53a
Author: Kevin Grandon <kevingrandon@yahoo.com>
Desc: Bug 1186279 - Convert ringtones switches to use web components

========

https://hg.mozilla.org/integration/gaia-central/rev/fefde1214d3e
Author: Kevin Grandon <kevingrandon@yahoo.com>
Desc: Merge pull request #31261 from albertopq/1179643-intermitent-chrome

Bug 1179643 - Intermitent appChrome ui test failure

========

https://hg.mozilla.org/integration/gaia-central/rev/6c4f65d41c27
Author: albertopq <albert.pastor@gmail.com>
Desc: Bug 1179643 - Intermitent appChrome ui test failure
2015-08-06 08:50:37 -07:00
Jonathan Kew
a38ee65e1c Bug 1183431 followup - Crashtest no longer asserts, so mark it appropriately on the CLOSED TREE. 2015-08-06 16:36:50 +01:00
B2G Bumper Bot
84653660e0 Bumping manifests a=b2g-bump 2015-08-06 08:33:32 -07:00
Jonathan Kew
14645b5c50 Bug 1183431 followup - Add the test files that I failed to "hg add" when updating the reftest patch, because it's going to burn the CLOSED TREE. 2015-08-06 16:25:07 +01:00
Jonathan Kew
096b8b567a Bug 1183431 - Ensure hypothetical box has a writing mode with the same block direction as the absolute containing block. r=dholbert 2015-08-06 15:44:50 +01:00
Jonathan Kew
ec513901f3 Bug 1183431 - Tests for hypothetical box computation (to determine static position of abspos element) where orthogonal writing modes are involved. r=dholbert 2015-08-06 15:44:48 +01:00