Commit Graph

27159 Commits

Author SHA1 Message Date
Wes Kocher
26efdcf2ba Backed out changeset de7aa6b08234 (bug 1194055) for windows 8 reftest permafail 2015-08-18 17:58:27 -07:00
Jonathan Kew
25f52e700a Bug 1194055 - GetSysFontInfo should return MS Shell Dlg 2 for eFont_Field and eFont_List on Windows. r=masayuki 2015-08-18 17:21:38 +01:00
Mason Chang
b5774eeed6 Bug 1190257. Use the previous vsync timestamp on windows 10. r=jrmuizel 2015-08-18 09:11:12 -07:00
Markus Stange
b58b4730d9 Bug 1187804 - Reftests for async scrolling with position:fixed in an iframe. r=kats 2015-06-23 23:18:33 -07:00
Markus Stange
fec0b4f324 Bug 1187804 - Annotate fixed-position layers with the scroll id of the scroll frame that they are fixed with respect to. r=mattwoodrow 2015-08-17 19:44:42 -04:00
Ryan VanderMeulen
5e10ab4b5c Merge m-c to inbound. a=merge 2015-08-18 10:58:07 -04:00
Ryan VanderMeulen
cd959e19f8 Merge b2g-inbound to m-c. a=merge 2015-08-18 10:41:52 -04:00
Andrew Osmond
124352f3cf Bug 1186273 - Part 1. Move preferences and observers into dedicated threadsafe module. r=dhylands 2015-08-18 07:42:12 -04:00
Brian Birtles
7d4d926aa6 Bug 1188251 part 12 - Use RestyleType::Layer in UpdateCascade; r=dholbert
When updating the cascade results between transitions and animations, if we
detect a change we force an update by taking the following steps:

 a. Updating the animation generation on the restyle manager
 b. Updating the animation generation on the collection
 c. Iterating over all the properties animated by the collection and, for
    each property that we can animate on the compositor, posting a restyle
    event with the appropriate change hint (nsChangeHint_UpdateTransformLayer
    or nsChangeHint_UpdateTransformOpacity)
 d. Marking the collection as needing refreshes
 e. Clearing the style rule refresh time so we generate a new style rule in
    EnsureStyleRuleFor

As it turns out, the newly-added
AnimationCollection::RequestRestyle(RestyleType::Layer) already performs a, b,
d, and e. It also:

* Ensures we are observing the refresh driver if need be (should have no effect
  in this case)
* Clears the last animation style update time on the pres context so that
  subsequent calls to FlushPendingNotifications will update animation style
  (it seems like we probably should have been doing this for changes to cascade
  results anyway)
* Posts a restyle event with restyle hint eRestyle_CSSTransitions or
  eRestyle_CSSAnimations
* Marks the document as needing a style flush (irrelevant since posting
  a restyle event does this anyway)

The only missing piece that would prevent using RequestRestyle in place of this
code when updating cascade results is (c) from the list above. However, (c)
should not be necessary since ElementRestyler::AddLayerChangesForAnimation()
explicitly checks for out-of-date layer animation generation numbers and adds
the appropriate change hints (nsChangeHint_UpdateTransformLayer etc.) to the
change list.
2015-08-18 16:11:55 +09:00
Brian Birtles
735ff9144b Bug 1188251 part 11 - Add RestyleType::Layer; r=dholbert
We currently have a series of methods that clobber various bits of animation
state to force animations on layers to be updated. This aligns closely with
the restyle code introduced in this patch series.

By re-using RequestRestyle when updating animations on layers, not only should
we be able to simplify the code somewhat but, in future, we should also be able
to have Animation objects use the same mechanism to update layers during
a regular tick.

For example, currently we have a bug where when an animation starts after
a delay with the same value as the backwards fill then we don't send the
animation to the compositor right away (see
https://dxr.mozilla.org/mozilla-central/rev/d6ea652c579992daa9041cc9718bb7c6abefbc91/layout/style/test/test_animations_omta.html#287).
By adding this Restyle::Layer value we should be able to fix that in future.
2015-08-18 16:11:55 +09:00
Brian Birtles
603a09ba64 Bug 1188251 part 10 - Remove throttling from EnsureStyleRuleFor; r=dholbert
EnsureStyleRuleFor contains logic for performing throttled updates to the style
rule but it is only used in one case: inside
nsTransitionManager::UpdateCascadeResults to determine what properties are
being animated by CSS animations.

We would like to remove throttling logic from EnsureStyleRuleFor altogether but
if that one case where it is currently used is run on every tick then removing
this logic could effectively mean we end up updating the style rule on every
tick. Fortunately nsTransitionManager::UpdateCascadeResults is only called
in the following cases:

1. From nsTransitionManager::StyleContextChanged (via
   TransitionManager::UpdateCascadeResultsWithTransitions), when we are
   processing style changes for transitions.

2. From AnimationCollection::EnsureStyleRuleFor (via
   nsAnimationManager::MaybeUpdateCascadeResults and
   nsTransitionManager::UpdateCascadeResultsWithAnimations), when we are
   updating the animation style rule from CSS animations.

3. From nsAnimationManager::CheckAnimationRule (via
   TransitionManager::UpdateCascadeResultsWithAnimationsToBeDestroyed), when
   we are processing style changes for CSS animations.

None of these things should be happenning on a regular throttle-able tick so by
removing this logic we shouldn't be causing any additional work.

I have verified, using a test case that combines transitions and animations on
the same property, that we have the same behavior with regard to calling
EnsureStyleRuleFor both before and after this patch (specifically we avoid
calling it altogether while running only the transition but when the animation
starts and clobbers the transition we end up calling EnsureStyleRuleFor once on
each tick).
2015-08-18 16:11:55 +09:00
Brian Birtles
0959beed1d Bug 1188251 part 9 - Request restyles from Animation::Tick; r=dholbert
In preparation for ultimately being able to run animations without a manager,
this patch moves the request restyle code from FlushAnimations to
Animation::Tick. (Ultimately most of this functionality should move to the
KeyframeEffect but for now Animation is fine.)
2015-08-18 16:11:55 +09:00
Wes Kocher
f6a10b2301 Merge inbound to central, a=merge 2015-08-17 17:00:42 -07:00
Wes Kocher
a766cb3417 Merge fx-team to central, a=merge 2015-08-17 16:54:21 -07:00
Ryan VanderMeulen
fa6ffdfa08 Bug 1195474 - Annotate 759249-1.html and 415394-1.xhtml as asserting in e10s mode. a=me 2015-08-17 15:48:20 -04:00
Ryan VanderMeulen
7512870e81 Bug 1195472 - Annotate 505912-1.html to expect one assertion in e10s mode. 2015-08-17 15:36:20 -04:00
Ryan VanderMeulen
e32420bdb9 Merge inbound to m-c. a=merge 2015-08-17 09:06:59 -04:00
Ben Tian
cac4eb9266 Bug 1192693 - [02] Remove bluetooth1 folder and rename webidl files, r=joliu, r=mrbkap 2015-08-17 15:30:34 +08:00
Brian Birtles
3801a43ea4 Bug 1188251 part 8 - Remove call to Animation::Tick from CheckAnimationRule; r=dholbert
We want to move the newly-introduced RequestRestyle call from FlushAnimations
to Animation::Tick. However, nsAnimationManager::CheckAnimationRule calls
Animation::Tick so this would cause us to start posting animation restyles
within a restyle.

Typically, Animations have an effect (currently there is only one type of
effect: KeyframeEffectReadOnly) and when there is any change in timing they
pass it down to their effect. However, the Animation is dependent on the
duration of the effect for determining if it is "finished" or not. As a result,
when an effect's timing changes, the owning Animation needs to know.

(The way this *should* work is that effects should tell their animation or
trigger some chain of events that causes animation's to update themselves.
However, the current implementation of effects is fairly primitive and does
not do this or even have a reference to the owning Animation. When we
implement the script API for updating the timing properties of effects we will
have to fix this but for now it is up to code in layout/style to update the
Animation when it touches the corresponding effect's timing.)

nsAnimationManager::CheckAnimationRule currently does this by calling
Animation::Tick() which ensures the Animation's finished state is updated
accordingly.

Ultimately we want to ensure that Animation::Tick is called exactly once per
frame (and at the appropriate point in that frame) so we'd like to remove this
call from CheckAnimationRule.

This patch achieves that by:

* Making Animation::SetEffect update the animation's timing - this is necessary
  for animations that are created by CheckAnimationRule and will be
  necessary when once we make Animation.effect writeable from script anyway.

* Calling Animation::SetEffect even for the case when we are updating the
  existing effect.

Another side-effect of calling Animation::Tick within
nsAnimationManager::CheckAnimationRule is that CSSAnimation::Tick queues
events. There are some tests (e.g. layout/style/test/test_animations.html) that
assume that animationstart events are dispatched immediately when new
animations are created. That will change with bug 1134163 but for now we
should maintain this existing behavior since changing this might introduce
compatibility issues that are best dealt with as a separate bug rather than
blocking this refactoring. To that end, this patch also explicitly queues
animationstart events for newly-created animations.
2015-08-17 13:59:45 +09:00
Brian Birtles
206e592672 Bug 1188251 part 7 - Move WillRefresh to CommonAnimationManager; r=dholbert
nsTransitionManager::WillRefresh and nsAnimationManager::WillRefresh are now
identical and all methods they call exist on CommonAnimationManager so we
can unify them there.
2015-08-17 13:59:44 +09:00
Brian Birtles
2e299dca17 Bug 1188251 part 6 - Unify FlushAnimations and FlushTransitions; r=dholbert
The implementations of FlushAnimations and FlushTransitions should now be all
but equivalent so this patch combines them into a single implementation on
CommonAnimationManager.

Regarding some of the minor differences between the two methods:

* The combined implementation drops the check for an empty list of collections
  found only in FlushTransitions. This seems like a very minor optimization
  that could possibly cause us to fail to unregister from the refresh driver
  if we forgot to do so when removing the last collection.

* The combined implementation uses the loop implementation from FlushAnimations
  since it is more compact.

This patch also removes the extra nested scope since it doesn't seem necessary.
2015-08-17 13:59:44 +09:00
Brian Birtles
ed5bbcb0c5 Bug 1188251 part 5 - Move some assertions from FlushTransitions to RequestRestyle; r=dholbert
There are a couple of assertions that only exist in FlushTransitions (and not
FlushAnimations). This patch moves them to RequestRestyle since they appear to
apply to either transitions or animations equally. By eliminating this
difference between FlushTransitions and FlushAnimations we should then be
in a position to combine them into a common method on the base class.
2015-08-17 13:59:44 +09:00
Brian Birtles
e903710ab6 Bug 1188251 part 4 - Move throttling checks to AnimationCollection::RequestRestyle; r=dholbert
This patch moves the additional checks (beyond those of Animation::CanThrottle)
from FlushAnimations/FlushTransitions to AnimationCollection::RequestRestyle.
These checks are on a per-collection basis hence it makes sense for the
collection to perform them. This also moves logic out of the managers which is
needed if we want to support script-based animations without introducing another
manager.
2015-08-17 13:59:44 +09:00
Brian Birtles
23e1fbe1ec Bug 1188251 part 3 - Add AnimationCollection::RequestRestyle; r=dholbert
Ultimately we want to move throttling logic to AnimationCollection and
Animation::Tick (and later to KeyframeEffect::SetParentTime). This is so that
we can support script-generated animations without having to introduce yet
another manager.

To that end this patch introduces a method on AnimationCollection that can be
called from Animation::Tick to perform the necessary notifications needed to
update style.

Later in this patch series we will extend RequestRestyle to incorporate more of
the throttling logic and further extend it to cover some of the other
notifications such as updating layers.

This patch tracks whether or not we have already posted a restyle for animation
to avoid making redundant calls. Calls to nsIDocument::SetNeedStyleFlush are
cheap and more difficult to detect when they have completed so we don't filter
redundant calls in the Restyle::Throttled case.

If mHasPendingAnimationRestyle is set and AnimationCommon::EnsureStyleRuleFor
is *never* called then we could arrive at situation where we fail to make post
further restyles for animation.

I have verified that if we fail to reset mHasPendingAnimationRestyle at the
appropriate point (e.g. resetting it at the end of EnsureStyleRuleFor *after*
the early-returns) then a number of existing tests fail.

Furthermore, I have observed that it is reset by the beginning of each tick
in almost every case except for a few instances of browser mochitests such as
browser/components/customizableui/test/browser_1007336_lwthemes_in_customize_mode.js.
In this case, during the async cleanup of the test, we have an opacity
transition on a vbox element that becomes display:none and appears to be skipped
during restyling. However, even in this case, EnsureStyleRuleFor is called
within one or at most two ticks and mHasPendingAnimationRestyle flag is cleared
(i.e. it does not get stuck).
2015-08-17 13:59:44 +09:00
Brian Birtles
31b93e48b4 Bug 1188251 part 2 - Check if a tick can be throttled in FlushAnimations using Animation::CanThrottle; r=dholbert
In FlushTransitions and FlushAnimations we use different mechanisms to see if a
transition/animation can be throttled on the current tick.

FlushTransitions calls Animation::CanThrottle whilst FlushAnimations calls
EnsureStyleRuleFor and checks if the rule has changed or not. These are not as
completely different as they might seem at first since, internally,
EnsureStyleRuleFor calls Animation::CanThrottle.

We would like to unify this behavior and simply use Animation::CanThrottle in
FlushAnimations as we do in FlushTransitions.

First, however, we have to account for the differences in these approaches:

1. Using the result of EnsureStyleRuleFor means we may *not* call
   PostRestyleForAnimation if an animation collection's mNeedsRefreshes member
   is false.

   This member is false when all animations have finished (or there are no
   animations in the collection). In this case EnsureStyleRuleFor will not
   update the style rule and we will end up assuming the tick can be throttled.
   *However*, in the case that all animations are finished
   Animation::CanThrottle will *also* return true (technically it will return
   false until we compose style for the first time after becoming finished but
   beyond that one moment it will return true) so skipping this check by using
   Animation::CanThrottle instead of EnsureStyleRuleFor should not
   make a significant difference.

2. Using the result of EnsureStyleRuleFor will mean that if we have already
   updated the style rule within a given tick we will avoid calling
   PostRestyleForAnimation (and call SetNeedStyleFlush instead). This can
   happen the first time we call FlushAnimations from
   PresShell::FlushPendingNotifications. (When we call FlushAnimations from
   nsAnimationManager::WillRefresh mStyleRuleRefreshTime will be stale and we
   won't apply this optimization. Furthermore after the first call to
   PresShell::FlushPendingNotifications we will typically skip calling
   FlushAnimations since PresShell::StyleUpdateForAllAnimationsIsUpToDate will
   typically return true).

   This seems like a possibly useful optimization although it is surprising we
   don't do the same for transitions. Note that this optimization applies
   regardless of whether we are performing a throttleable flush or not. That is,
   even if we pass CommonAnimationManager::Cannot_Throttle we will still end up
   throttling the tick in this case. Furthermore, we will mark the document as
   needing a style flush even though this does not appear to be necessary.

   This patch copies this optimization (checking if mStyleRuleRefreshTime) to
   FlushAnimations so we can maintain this behavior when calling
   Animation::CanThrottle instead of EnsureStyleRuleFor. It also applies the
   same behavior to FlushTransitions for consistency (and so we can later
   combine FlushAnimations and FlushTransitions).

   Note that we apply this optimization *before* calling Tick since it should
   only apply once we have already Tick'ed the animations in the collection.
   We will first hit FlushAnimations as a result of the refresh driver calling
   nsAnimationManager/nsTransitionManager::WillRefresh at which point
   mStyleRuleRefreshTime should be stale. Using this order not only saves
   redundant work but also makes moving the restyle code to Animation later on
   more straightforward.

   (In future we will divorce WillRefresh and FlushAnimations and only call
   Tick in WillRefresh and only perform this optimization FlushAnimations.)

3. Using the result of EnsureStyleRuleFor means that while checking if we can
   throttle or not we also update the style rule in FlushAnimations. That seems
   like an odd side-effect particularly since FlushTransitions doesn't do the
   same thing.
2015-08-17 13:59:44 +09:00
Brian Birtles
e801f2fcb1 Bug 1188251 part 1 - Remove transitions cleanup from FlushTransitions; r=dholbert
There is no longer anything in FlushTransitions that modifies the set of
transitions. I believe this changed as of bug 960465, specifically changeset
https://hg.mozilla.org/mozilla-central/rev/b2ee72589c18, so that this code is
no longer needed.

By removing this we can further align FlushAnimations and FlushTransitions.
2015-08-17 13:59:44 +09:00
William Chen
161ace8311 Bug 1181130 - Part 3: Keep track of editable descendants per node and prevent NS_STYLE_USER_SELECT_ALL selection for nodes with editable descendants. r=bz 2015-08-14 10:52:38 -07:00
Ehsan Akhgari
d2501342c4 Bug 1181130 - Part 2: Mark editable regions inside non-editable regions as -moz-user-select: -moz-text; r=dbaron 2015-08-14 10:52:33 -07:00
Ehsan Akhgari
51d7676c1e Bug 1181130 - Part 1: Add support for -moz-user-select: -moz-text; r=dbaron 2015-08-14 10:49:27 -07:00
Gijs Kruitbosch
308fed7444 Bug 1157292 - include XBL stylesheets in the inspector's list of stylesheets, r=dholbert,heycam 2015-08-12 13:43:39 +01:00
Arthur Edelstein
c35d3471c8 Bug 1192090 - Add 'aero-lite' Windows theme to 418986 tests. r=heycam 2015-08-13 13:02:00 -04:00
Aryeh Gregor
a0d8e26be1 Bug 1179451 - Part 1: Rewrite some ternary operators as if/else. r=froydnj 2015-08-13 15:22:48 +03:00
Gijs Kruitbosch
80e8233e2d Bug 1088637 - check we get the right transition event, r=Enn 2015-08-17 13:43:28 +01:00
Ting-Yu Lin
f5099d4b51 Bug 1194063 - Update link to point to the diagram directly. r=mtseng 2015-08-17 21:22:00 +08:00
Ting-Yu Lin
2603203275 Bug 1194063 - Always launch caret timer in cursor mode. r=mtseng
If the timer is not launched when the content is empty, the first caret
will always has Appearance::NormalNotShown, which is not consistent with
the behavior when the caret is shown when the content is not empty.

After this patch, Gaia will always receive an update event after 3
seconds timeout. Hence fixed a bug that the shortcut text dialog does
not hide after 3 seconds timeout.
2015-08-17 21:20:00 +08:00
Ryan VanderMeulen
0e0af6dbb2 Merge m-c to inbound. a=merge 2015-08-17 09:07:43 -04:00
Masayuki Nakano
7f356ebad3 Bug 555642 part.1 nsCaret should have a way to override the caret visible state for hiding caret temporarily and nsEditor should hide caret if composition string doesn't have caret information r=roc 2015-08-17 20:58:38 +09:00
L. David Baron
ecd4aaf948 Bug 1146002 - Increase fuzzy-if(Android) max-difference for box-sizing-replaced-003 to match box-sizing-replaced-002 to fix frequent intermittent failure. No review. 2015-08-16 23:12:43 +02:00
Jonathan Kew
af085b7586 Bug 1194493 - Ensure the 'mVertical' flag is set appropriately on the nsFontMetrics we use to draw text for an nsTextBoxFrame. r=smontagu 2015-08-16 15:09:08 +01:00
Kartikaya Gupta
453b31e327 Bug 1191277 - Ensure that we don't find clusters of clickable elements when there is no possible way for the heuristic to actually target those elements. r=domivinc 2015-08-15 11:15:29 -04:00
Cameron McCormack
6e7ec6c889 Bug 1146101 - Test. r=dbaron a=abillings 2015-08-14 12:24:49 +10:00
Mason Chang
8e20cbd768 Bug 1144946 - Delete PreciseRefreshDriverTimerWindowsDwmVsync refresh driver timer. r=roc 2015-08-13 08:22:28 -07:00
Xidorn Quan
ecdc64fc29 Bug 1186721 - Suppress line break due to soft hyphen inside ruby. r=jfkthame 2015-08-13 22:39:51 +10:00
Francois Marier
6349d3c212 Bug 992096 - Implement Sub Resource Integrity [1/2]. r=baku,r=ckerschb
Code changes
2015-08-12 20:19:11 -07:00
L. David Baron
f812cebb7e Bug 1195142 patch 3 - Link to correct specification URLs so the CSSWG test suite system is happy. 2015-08-18 08:20:35 +02:00
Ms2ger
f0d59f4600 Remove prefixed properties. No bug.
(Imported from https://hg.csswg.org/test/ by dbaron.)
2015-08-11 12:21:28 +02:00
L. David Baron
b4ca127aea Bug 1195142 patch 2 - Add reftests for will-change creating a stacking context. r=BenWa 2015-08-18 08:13:56 +02:00
L. David Baron
6574de9487 Bug 1195142 patch 1 - Set CSS_PROPERTY_CREATES_STACKING_CONTEXT for the opacity property. r=BenWa
This isn't actually needed for the only caller (which ensures that
frames with will-change: opacity create a stacking context), since
nsIFrame::BuildDisplayListForChild checks HasOpacity, which checks for
NS_STYLE_WILL_CHANGE_OPACITY.  However, it's good to have the bit set
for consistency in case we use it elsewhere.
2015-08-18 08:13:56 +02:00
Robert O'Callahan
b12ac5e986 Bug 1179288. Make position:fixed induce a stacking context. r=heycam 2015-08-17 11:02:54 +12:00
Wes Kocher
9eb02381a9 Merge m-c to inbound, a=merge 2015-08-17 17:15:24 -07:00