Commit Graph

8807 Commits

Author SHA1 Message Date
Birunthan Mohanathas
fd290c6aa3 Bug 1185763 - Part 3: Rename nsTArray::MoveElementsFrom to AppendElements. r=froydnj 2015-08-11 08:29:46 -07:00
Birunthan Mohanathas
0e83cd889c Bug 1185763 - Part 1: Always use mozilla::Move with nsTArray::MoveElementsFrom. r=froydnj 2015-08-11 08:29:46 -07:00
Kartikaya Gupta
7f7e3ef215 Bug 1189443 - Don't round down the margin amounts when inflating the displayport. r=dvander 2015-08-10 18:30:45 -04:00
Matt Woodrow
cd8614201c Bug 1187432 - Avoid scheduling main-thread paints for scrolls handled by apz. r=tn 2015-08-07 15:37:56 -04:00
Kartikaya Gupta
a08d86c0a3 Bug 1168487 - Update the last use site of ScrollbarAreaToExcludeFromCompositionBoundsFor to use LD pixels. r=tn 2015-08-07 14:23:13 -04:00
Mats Palmgren
5a0dd61b96 Bug 1178575 - Intersect the clip rect with aDirtyRect. r=roc 2015-08-07 14:05:48 +02:00
Lee Salzman
bfe0ffd48b Bug 1191609 - Always stroke CSS border sides separately from corner fills. r=mstange 2015-08-06 00:33:44 -04:00
Brian Birtles
b75f33037c 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
d21a5ec32c 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
a8682cf4b0 Bug 1180125 part 8 - Dispatch transition events from refresh driver; r=dbaron
This patch causes transition events to be dispatched as a separate step after
sampling the transitions. Eventually this will allow us to sample transitions
from their timeline (independently of where they came from and in potentially
any order) by separating the concepts of sampling and event dispatch.
2015-07-29 10:57:40 +09:00
Brian Birtles
256f836f71 Bug 1180125 part 7 - Queue transition events from CSSTransition::Tick; r=dbaron
This patch moves the logic for queueing events out of the logic for flushing
transitions making it a separate step. It still doesn't delay the dispatch of
those events into a separate step, however. That is done in a subsequent patch.

This patch also makes sure to clear any queued events when the nsPresShell that
owns the transition manager is destroyed. We don't expect CSSTransition::Tick to
be called anywhere except nsTransitionManger::FlushTransitions so there
shouldn't be any orphaned events but for completeness it seems best to add this
now. (Later, when we tick transitions from their timeline we will need this.)

This patch introduces a separate flag to CSSTransition for tracking if a
transition is newly-finished so we can correctly dispatch the transitionend
event. Although, this may seem to be redundant with the "IsFinishedTransition"
we also track, that state will soon be removed in bug 1181392 and hence this
flag will be needed then.

Note that Animation already has flags mIsPreviousStateFinished and
mFinishedAtLastComposeStyle which would appear to be similar however,

- mIsPreviousStateFinished will be removed in bug 1178665 and is updated more
  often than we queue events so it is not useful here.
- mFinishedAtLastComposeStyle is used to determine if we can throttle a style
  update and is also updated more frequently than we queue events and hence
  can't be used here.

Once we guarantee one call to Tick() per frame we may be able to simplify this
by tracking "state on last tick" but for now we need this additional flag on
CSSTransition. CSSAnimation has a similar flag for this
(mPreviousPhaseOrIteration) which we may be able to unify at the same point.
2015-07-29 10:57:40 +09:00
Brian Birtles
e4cb3c7353 Bug 1180125 part 2 - Move AnimationCommon classes out of CSS namespace; r=dbaron
The long-term plan is to drop the mozilla::css namespace altogether. Before we
go to much further with refactoring code in AnimationCommon, we should drop
usage of the mozilla::css namespace. Specifically, this patch moves the
CommonAnimationManager and AnimValuesStyleRule classes to the mozilla namespace.
2015-07-29 10:57:39 +09:00
Brian Birtles
20feb8ddef 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
Brian Birtles
4b7b196882 Bug 1180125 part 1 - Queue and dispatch CSS animation events as a separate step; r=dbaron
This patch prepares the way for script-generated events by making
event dispatch a separate process that happens after sampling animations.
This will allow us to sample animations from their associated timeline
(removing the need for a further manager to tracker script-generated
animations).

Furthermore, once we sample animations from timelines the order in which they
are sampled is likely to be more or less random so by making event dispatch at
separate step, we have an opportunity to sort the events and dispatch in
a consistent and sensible order. It also ensures that event callbacks will
not be run until all animations (including transitions) have been updated
ensuring they see a consistent view of timing properties.

This patch only affects event handling for CSS animations. Transitions will
be dealt with in a subsequent patch.
2015-07-29 10:57:39 +09:00
Jeremy Chen
29b1ef5c80 Bug 1181418 - Send selectionEditable info to app_text_selection_dialog. r=tlin, r=kanru, sr=smaug 2015-07-31 04:34:00 +08:00
Cameron McCormack
2527b5f2f1 Bug 1190254 - Use same conditions to call ReparentStyleContext in RestyleUndisplayedNodes as in RestyleSelf. r=mats 2015-08-06 09:16:00 +10:00
Kartikaya Gupta
86ef51386e Bug 1189837 - Subtract scrollbars in LD pixels rather than CSS pixels. r=mstange 2015-08-05 14:39:42 -04:00
Cameron McCormack
6e3e83210a Bug 1180118 - Part 11: Use ReparentStyleContext even if eRestyle_SomeDescendants is used. r=bzbarsky 2015-08-05 22:42:21 +10:00
Cameron McCormack
a449d7568c Bug 1180118 - Part 10: Logging. r=bzbarsky 2015-08-05 22:42:21 +10:00
Cameron McCormack
ee642530be 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
Cameron McCormack
bd001a68ec Bug 1180118 - Part 8: Keep track of the closest restyle root in AddPendingRestylesForDescendantsMatchingSelectors. r=bzbarsky 2015-08-05 22:42:21 +10:00
Cameron McCormack
613625e1b5 Bug 1180118 - Part 7: Split out FindClosestRestyleRoot and allow passing in a pre-computed restyle root to AddPendingRestyle. r=bzbarsky 2015-08-05 22:42:21 +10:00
Cameron McCormack
9bb0cce6bd Bug 1180118 - Part 5: Add a RestyleHintData outparam to HasAttributeDependentStyle for use with eRestyle_SomeDescendants. r=bzbarsky 2015-08-05 22:42:21 +10:00
Cameron McCormack
9e49ce1258 Bug 1180118 - Part 3: Convert eRestyle_SomeDescendants into eRestyle_Self for elements that match selectors. r=bzbarsky 2015-08-05 22:42:20 +10:00
Cameron McCormack
b2b0c4777c 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
Birunthan Mohanathas
9b6236a10a Bug 1191100 - Remove XPIDL signature comments in .cpp files. r=ehsan
Comment-only so DONTBUILD.
2015-08-04 16:17:36 -07:00
Carsten "Tomcat" Book
22c46d8958 Backed out 13 changesets (bug 1180118) for crashes on a CLOSED TREE
Backed out changeset c65d298d7cfa (bug 1180118)
Backed out changeset 7c5ebadc3fc9 (bug 1180118)
Backed out changeset 91a3e2205388 (bug 1180118)
Backed out changeset 15ad6049b940 (bug 1180118)
Backed out changeset 9b41cd9f2bc5 (bug 1180118)
Backed out changeset 37493f6eef20 (bug 1180118)
Backed out changeset b7ec8d4d2d7e (bug 1180118)
Backed out changeset cfeeae42d514 (bug 1180118)
Backed out changeset 9bcc3233f3c8 (bug 1180118)
Backed out changeset b99c358a6fea (bug 1180118)
Backed out changeset 4a7b79980353 (bug 1180118)
Backed out changeset 20984dfa4302 (bug 1180118)
Backed out changeset ef165b896cf4 (bug 1180118)
2015-08-04 12:20:20 +02:00
Cameron McCormack
0fddbc0824 Bug 1180118 - Second followup warning-as-error build fix. 2015-08-04 17:50:32 +10:00
Cameron McCormack
6bec42f7ac Bug 1180118 - Followup warning-as-error build fix. 2015-08-04 17:49:53 +10:00
Cameron McCormack
e0954cacf9 Bug 1180118 - Part 11: Use ReparentStyleContext even if eRestyle_SomeDescendants is used. r=bzbarsky 2015-08-04 17:27:53 +10:00
Cameron McCormack
1249db8d6f Bug 1180118 - Part 10: Logging. r=bzbarsky 2015-08-04 17:27:53 +10:00
Cameron McCormack
3d207db04f Bug 1180118 - Part 9: Clear nsCSSSelector pointers in the pending restyle tracker if they might be stale. r=bzbarsky 2015-08-04 17:27:53 +10:00
Cameron McCormack
0dfed4ea0c Bug 1180118 - Part 8: Keep track of the closest restyle root in AddPendingRestylesForDescendantsMatchingSelectors. r=bzbarsky 2015-08-04 17:27:53 +10:00
Cameron McCormack
429fc23695 Bug 1180118 - Part 7: Split out FindClosestRestyleRoot and allow passing in a pre-computed restyle root to AddPendingRestyle. r=bzbarsky 2015-08-04 17:27:53 +10:00
Cameron McCormack
d24ea39dec Bug 1180118 - Part 5: Add a RestyleHintData outparam to HasAttributeDependentStyle for use with eRestyle_SomeDescendants. r=bzbarsky 2015-08-04 17:27:53 +10:00
Cameron McCormack
8e552e06ea Bug 1180118 - Part 3: Convert eRestyle_SomeDescendants into eRestyle_Self for elements that match selectors. r=bzbarsky 2015-08-04 17:27:52 +10:00
Cameron McCormack
4d7ed09b82 Bug 1180118 - Part 2: Add eRestyle_SomeDescendants restyle hint and pass associated restyle hint data into restyle methods. r=bzbarsky 2015-08-04 17:27:52 +10:00
Nicholas Nethercote
f23a15f104 Bug 1189156 (part 2) - Don't use enumeration style for nsTHashtable::SizeOf{In,Ex}cludingThis(). r=erahm.
After this change, we have ShallowSizeOf{In,Ex}cludingThis(), which don't do
anything to measure children. (They can be combined with iteration to measure
children.)

And we still have the existing single-arg SizeOf{In,Ex}cluding() functions,
which work if the entry type itself defines SizeOfExcludingThis().
2015-07-29 01:50:52 -07:00
L. David Baron
24a04c0947 Bug 1187851 patch 3 - Rename nsChangeHint_AddOrRemoveTransform to nsChangeHint_UpdateContainingBlock. r=roc
This is because patch 4 now uses AddAndRemoveTransform hints for changes
that are other than adding and removing a transform.  There's still a
little bit of transform-related stuff there too (which I did make
conditional in patch 2).
2015-08-03 20:18:00 -07:00
L. David Baron
9fa4e071c6 Bug 1187851 patch 2 - Cleanup to prepare for making dynamic changes to filter and perspective change fixed position containing block for descendants. r=roc 2015-08-03 20:18:00 -07:00
Daniel Holbert
ccf479d5b1 Bug 1183786 - Part 4: Drop unnecessary '!!' boolification. r=tn 2015-08-03 17:13:08 -07:00
Daniel Holbert
e67b0fe9eb 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
Eric Rahm
38da96738d Bug 1183786 - Part 2: Delay updating after prefs changed if detached. r=tn r=dholbert 2015-07-30 20:47:26 -07:00
Eric Rahm
6ea570b8b8 Bug 1183786 - Part 1: Refactor timer setup code into a helper function. r=dholbert 2015-07-30 14:24:51 -07:00
Robert O'Callahan
c0b6fcd9ee Bug 1184842. Route aOldValue/aNewValue to AttributeData. r=heycam 2015-07-22 15:54:07 +12:00
Robert O'Callahan
3e3003e4ce Bug 1184842. Add aNewValue to nsIMutationObserver::AttributeWillChange. r=peterv 2015-07-25 18:05:19 +12:00
Robert O'Callahan
53c0044a87 Bug 1184842. Pass aOldValue to all mutation observers. r=peterv 2015-07-25 18:01:19 +12:00
Ryan VanderMeulen
fa2176eb4f Merge inbound to m-c. a=merge 2015-08-03 15:02:19 -04:00
Carsten "Tomcat" Book
0724563b89 Merge mozilla-central to fx-team 2015-08-03 16:16:12 +02:00
L. David Baron
2bc4edbca0 Backed out changeset f24dbdeeaef1 (Bug 1187851 patch 1) for reflow counting failures in Gaia integration tests apps/system/test/marionette/edges_gesture_test.js and apps/system/test/marionette/homescreen_navigation_test.js . 2015-08-02 22:35:28 -07:00