Граф коммитов

103 Коммитов

Автор SHA1 Сообщение Дата
Brian Birtles 65f06d35fe Bug 1253476 - Implement Animation.commitStyles; r=boris,emilio,bzbarsky,smaug
Differential Revision: https://phabricator.services.mozilla.com/D30327

--HG--
extra : moz-landing-system : lando
2019-05-20 06:04:23 +00:00
Brian Birtles 5b145a6de4 Bug 1253476 - Add remove events; r=boris,bzbarsky
This patch introduces the machinery for dispatching remove events but does not
actually cause removing to do anything to the output of the animation beyond
updating its replaceState member.

The expected behavior is defined in:

  https://drafts.csswg.org/web-animations-1/#removing-replaced-animations

And the corresponding IDL members are defined in:

  https://drafts.csswg.org/web-animations-1/#animation
  https://drafts.csswg.org/web-animations-1/#enumdef-animationreplacestate

Tests for these events are added in the next patch in this series.

Differential Revision: https://phabricator.services.mozilla.com/D30322

--HG--
extra : moz-landing-system : lando
2019-05-20 05:48:29 +00:00
Miko Mynttinen f579c8f5c5 Bug 1540785 - Part 1: Introduce nsDisplayItemBase r=mattwoodrow
***

Differential Revision: https://phabricator.services.mozilla.com/D27579

--HG--
extra : moz-landing-system : lando
2019-04-22 19:57:59 +00:00
Emilio Cobos Álvarez f8a54cc34d Bug 1545781 - One of the versions of EffectCompositor::PreTraverse is dead code. r=hiro
Callers were removed in bug 1540220.

Differential Revision: https://phabricator.services.mozilla.com/D28196

--HG--
extra : moz-landing-system : lando
2019-04-19 22:01:00 +00:00
Sylvestre Ledru ef0bfc3822 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D24168

--HG--
extra : moz-landing-system : lando
2019-03-31 15:12:55 +00:00
Mats Palmgren 9e5f85edc2 Bug 1538618 - [css-pseudo] implement animation support for ::marker pseudos. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D25003

--HG--
extra : rebase_source : 999373f16c816cdd0dd64b1cc3f9f3f30bb12003
extra : amend_source : 829c0fc25afc55d50b70aebc1f3b9f0e8f06c458
2019-03-26 05:48:26 +01:00
Emilio Cobos Álvarez ad066f1df7 Bug 1536586 - Simplify a bit our generated bindings by getting rid of FooBorrowed and FooBorrowedMut. r=heycam
This reduces a lot the boilerplate that's needed in order to add simple binding
functions.

This starts using &Foo and Option<&Foo> instead, and as a result we need to
remove the servo_function_signatures test, which is a bit unfortunate.

I think it's worth though, this causes problems on some platforms (see bug
1534844), and messing up the functions signature is not something that I've ever
seen (other than bug 1308234, which already had all the FooBorrowed mess which
I'm removing).

Also, cbindgen understands references and Option<&Foo>, so it will be the way to
go in the future.

After this patch we can also remove HasSimpleFFI, but I've kept it for now since
I still use it in a few places, and this patch is quite big on its own.

Differential Revision: https://phabricator.services.mozilla.com/D24092

--HG--
extra : moz-landing-system : lando
2019-03-21 17:00:27 +00:00
Boris Chiou 87c575a7ac Bug 1533594 - Set performance warning by a property set. r=hiro
We want to set the performance warning by a property set, so update it.
Besides, add more tests for individual transforms (translate, rotate,
scale).

Differential Revision: https://phabricator.services.mozilla.com/D19633

--HG--
extra : moz-landing-system : lando
2019-03-21 17:40:11 +00:00
Brian Birtles 04e79479f6 Bug 1518816 - Add EffectSet::GetEffectSetForFrame and use it in FindAnimationsForCompositor; r=hiro
There are many bugs regarding our use of EffectSet::GetEffectSet(nsIFrame*)
because the intention of the caller is not clear. If it is called for the
primary frame of display:table content do we expect it to get the EffectSet
associated with the style frame or not? Generally it depends on if we are
looking for transform animations or not.

Rather than inspecting each call site and making it choose the appropriate frame
to use, this patch introduces a new method to EffectSet to get the appropriate
EffectSet based on the properties the caller is interested in.

This patch also uses this function in FindAnimationsForCompositor which in turns
fixes the glitching observed on Tumblr that arose since a number of places in
our display list code were passing the style frame to
EffectCompositor::HasAnimationsForCompositor.

Over the remainder of this patch series we will convert more callers of
EffectSet::GetEffectSet(nsIFrame*) to this new method before renaming
EffectSet::GetEffectSet to GetEffectSetForStyleFrame to make clear how the
method is intended to work.

Differential Revision: https://phabricator.services.mozilla.com/D23282

--HG--
extra : moz-landing-system : lando
2019-03-18 04:10:30 +00:00
Boris Chiou a47dc39197 Bug 1526850 - Part 3: Use DisplayItemType as the input of AddTransitionsAndAnimationsToLayer. r=hiro
Transform display item may have multiple properties, so it's better to
use display item type as the input.

Also, factor some code out of AddAnimationsForProperty, so we can easier
to extend this for multiple properties.

We will pass a list of layers::Animation to the compositor thread. In
this list, the animations belonging to the same property are grouped together,
so we can easily separate the animations by property and sample the animations
for each property on the compositor thread. (Will do this in Bug 1425837.)

Depends on D19628

Differential Revision: https://phabricator.services.mozilla.com/D19629

--HG--
extra : moz-landing-system : lando
2019-03-01 21:13:05 +00:00
Boris Chiou 97ae508f2d Bug 1526850 - Part 2: Let FindAnimationsForCompositor take nsCSSPropertyIDSet. r=hiro
We use DisplayItemType as the input of HasAnimationsForCompositor, and
nsCSSPropertyIDSet as the input of GetAnimationsForCompositor.

The caller of HasAnimationsForCompositor just wants to check if there is
any compositor animation for a display item, so we can replace it by the
display item, and get the properties from this display item.

However, the caller of GetAnimationsForCompositor may use a subset of
transform-like properties for getting scale factors, or use all the
transform-like properties for sending all transform animations to the
compositor thread.

Depends on D19630

Differential Revision: https://phabricator.services.mozilla.com/D19628

--HG--
extra : moz-landing-system : lando
2019-03-01 21:13:03 +00:00
Boris Chiou 55287b9a0b Bug 1526850 - Part 1: Add a function which sets RunningOnCompositor by DisplayItemType. r=hiro
FrameLayerBuilder needs to clear this flag by DisplayItemType, so we add
a new function for it.

Differential Revision: https://phabricator.services.mozilla.com/D19630

--HG--
extra : moz-landing-system : lando
2019-03-01 21:13:01 +00:00
Emilio Cobos Álvarez dad3a20b22 Bug 1525955 - Include anon boxes in CSSPseudoElementType, to remove ComputedStyle::mPseudoTag. r=heycam
This is more consistent with what the Rust bits of the style system do, and
removes a pointer from ComputedStyle which is always nice.

This also aligns the Rust bits with the C++ bits re. not treating xul pseudos as
anonymous boxes. See the comment in nsTreeStyleCache.cpp regarding those.

Can't wait for XUL trees to die.

Depends on D19001

Differential Revision: https://phabricator.services.mozilla.com/D19002

--HG--
extra : moz-landing-system : lando
2019-02-19 13:44:33 +00:00
Brian Birtles 361e464182 Bug 1518374 - Drop unused aEffectSet parameter from EffectCompositor::AllowCompositorAnimationsOnFrame; r=hiro
Depends on D15900

Differential Revision: https://phabricator.services.mozilla.com/D15901

--HG--
extra : moz-landing-system : lando
2019-01-08 06:42:56 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Hiroyuki Ikezoe 653d6188cb Bug 1506988 - Factor out EffectCompositor::AllowCompositorAnimationsOnFrame. r=birtles
Depends on D12368

Differential Revision: https://phabricator.services.mozilla.com/D12396

--HG--
extra : moz-landing-system : lando
2018-11-22 04:00:42 +00:00
Hiroyuki Ikezoe 437d6b5387 Bug 1412716 - De-templatize EffectCompositor::UpdateEffectProperties and relevant stuff. r=emilio
MozReview-Commit-ID: K8yb8Kw16Mr

--HG--
extra : rebase_source : b5153f46ecd0352496b6222c847ef5663aff6ab7
2018-04-09 20:15:59 +09:00
Xidorn Quan 0401ef821e Bug 1447828 part 1 - Remove StyleBackendType uses from dom/animation. r=emilio
MozReview-Commit-ID: 3INWUuocNPm

--HG--
extra : rebase_source : 1e024084e325b075b3c1b534b544092d7f792e2e
extra : source : 1bcf22436ced3f5b2afd6a7db4250ff5b79f71c0
2018-03-29 02:29:42 +11:00
Jonathan Watt 82ebebe276 Bug 1448714 - Fix up comments referring to 'style context' after the rename of nsStyleContext. r=emilio 2018-03-23 13:49:21 +00:00
Emilio Cobos Álvarez e341b20ec4 Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt on a CLOSED TREE
MozReview-Commit-ID: JPopq0LudD
2018-03-22 20:06:24 +01:00
Emilio Cobos Álvarez 5dd797f154 Back out changeset b683bb3f22a1 (Bug 1447483) for not landing with all the files. r=me on a CLOSED TREE
This reverts commit 1808914126bb9f9e4a82d2c3d7ac961885fe7d62.

MozReview-Commit-ID: 5skESBseEvo
2018-03-22 20:05:22 +01:00
Emilio Cobos Álvarez ca5ac79cca Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt
MozReview-Commit-ID: JPopq0LudD
2018-03-22 19:48:42 +01:00
Jonathan Watt f3e6656403 Bug 1447367 - Remove files that are not built when MOZ_OLD_STYLE is not defined. r=emilio
MozReview-Commit-ID: D9bEPfTSw61
2018-03-07 18:08:41 +00:00
Emilio Cobos Álvarez f7522ae728 Bug 1447358: Unifdef the old style system code. r=jwatt
Summary:
This has been automatically generated using:

  http://dotat.at/prog/unifdef/

And:

find $OBJDIR -type f -name '*.h' |
while read FILE; do
  echo "$FILE"
  unifdef -m -DMOZ_STYLO -UMOZ_OLD_STYLE "$FILE";
done

find $OBJDIR -type f -name '*.cpp' |
while read FILE; do
  echo "$FILE"
  unifdef -m -DMOZ_STYLO -UMOZ_OLD_STYLE "$FILE";
done

MozReview-Commit-ID: I4NdKqbMXzJ

Reviewers: jwatt

Bug #: 1447358

Differential Revision: https://phabricator.services.mozilla.com/D779
2018-03-21 10:20:34 +01:00
Hiroyuki Ikezoe e6806e41d7 Bug 1444221 - #ifdef out some animation related stuff for MOZ_OLD_STYLE. r=xidorn
MozReview-Commit-ID: 9VC4qUbO6uK

--HG--
extra : rebase_source : 79113eb99cd784dc9a591bb9529381a932f07f97
2018-03-09 07:09:44 +09:00
Hiroyuki Ikezoe 77efac4019 Bug 1439428 - Make EffectCompositor::UpdateCascadeResults public. r=birtles
We will call the function directly in a sequential task in the case where we
already detected that !important styles for animations has been changed in
parallel traversal.

MozReview-Commit-ID: 7j6CfONYD08

--HG--
extra : rebase_source : 5ac29124cefbc8e57231d0acb9b1749b2c9587c0
2018-02-23 09:05:26 +09:00
Hiroyuki Ikezoe 0ca9f2c309 Bug 1417354 - Add a method to clear all pending restyle requests for a given element and its pseudos. r=birtles
MozReview-Commit-ID: DZkbwUPiPTd

--HG--
extra : rebase_source : b1993ea863a261841be1edfc3b2dee7655123fe8
2018-02-21 07:00:20 +09:00
Cameron McCormack d02e54b79b Bug 1430014 - Part 5: Stop building old style system classes when MOZ_OLD_STYLE is not defined. r=xidorn
MozReview-Commit-ID: CIHyPdF7Exl

--HG--
extra : source : 78a2fc781eead47af3923efcde58569c5d882ab1
2018-02-01 15:04:04 +11:00
Cameron McCormack cc7db5c40c Bug 1430014 - Part 4: #ifdef out unnecessary code when the old style system is not built. r=xidorn
MozReview-Commit-ID: 1FZ9VzjcPzN

--HG--
extra : source : de22d220635f8c059834b76f769d5215ab1a8b5b
2018-02-01 15:04:04 +11:00
Emilio Cobos Álvarez f3053729c9 Bug 1406750: Fix detection of animations to avoid flushing. r=hiro,birtles
This fixes multiple things:

 * EffectCompositor was using the light tree instead of the flat tree.

 * When we insert an element inside the document, we may not style it right away
   (we mark it for lazy frame construction with the NODE_NEEDS_FRAME). Since we
   trigger animations and transitions from the traversal, we can't skip flushing
   if we call getComputedStyle on any of those.

MozReview-Commit-ID: DpAhmLH3uJ2
2017-10-25 19:02:01 +02:00
Nicholas Nethercote d225f7151b Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP

--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
2017-10-03 09:05:19 +11:00
Wei-Cheng Pan f3f406f76b Bug 1363805 - Part 3: Do lazy flushing if possible. r=heycam
Skips flushing current document if the target of getComputedDOMStyle cannot be
affected by any pending restyles.

MozReview-Commit-ID: C87HDIDvOth

--HG--
extra : rebase_source : 064880493f9aac2599689cdd0749200bb579c60b
2017-05-23 12:02:11 +08:00
Hiroyuki Ikezoe 84aff91995 Bug 1336772 - Request any restyles required by changes to the cascade result. r=birtles
When an animation is newly created while the same property transition is
running, the transition style rule persists until we call RequestRestyle() for
transitions level. That means if user calls getComputedStyle for the property
right after creating animation, the style obtained by getComputedStyle still
included the transitions level rule. As a result, the transitions level style
overrides newly created animation style until the next normal restyling process
happens (i.e. process transition level restyle request). Vice versa, in the
case where an animation is removed, transitions level style does not appear
until the next normal restyling.

This patch fixes this problem by trigerring a resyle of the transitions level
when an animation is created or removed.

MozReview-Commit-ID: HY6amLmDHTi

--HG--
extra : rebase_source : 67e58dc9a6c695299c3eef684bf7357153c5168b
2017-09-05 16:34:24 +09:00
Hiroyuki Ikezoe fb03af5d7d Bug 1388031 - Process normal traversal for throttled animation flush as well. r=bholley
MozReview-Commit-ID: BirD8BDMifp
2017-08-11 20:34:06 -07:00
Hiroyuki Ikezoe cdde6f6108 Bug 1368889 - Post animation restyle hint againt pseudo element instead of its parent. r=birtles
To traverse pseudo elements in animation-only restyle, the pseudo element
itself needs the animation-only dirty bit.

MozReview-Commit-ID: 11RfVqnPXfJ

--HG--
extra : rebase_source : d048c9a053c03bf3fef46fcbfd9cbd5f60204e1d
2017-06-08 10:22:25 +09:00
Hiroyuki Ikezoe 14e0273b91 Bug 1367293 - Don't get parent style for GetComputedKeyframeValuesFor. r=birtles
MozReview-Commit-ID: 7WjsO7P2QGz

--HG--
extra : rebase_source : b9d2d672dd670f54174a5811c7d28efe268c0c4d
2017-06-02 09:38:54 +09:00
Boris Chiou 38215cedea Bug 1334036 - Part 11: Trigger animation-only restyle when we handle an event with coordinates. r=birtles,heycam
We need to request an animation-only restyle to force flush all throttled
animations on main thread when we handle an event with coordinates
(e.g. mouse event).

MozReview-Commit-ID: KkjeQVsLgTl

--HG--
extra : rebase_source : 314408062e719e9f52df9a6726e2f3dad817bbef
2017-05-19 16:16:41 +08:00
Boris Chiou 5ab8026281 Bug 1334036 - Part 7: Merge two similiar MaybeUpdateCascadeResults functions. r=birtles
MozReview-Commit-ID: 2NDdQRF3DQ8

--HG--
extra : rebase_source : b6b002e19a459acd644024a78532ab7923e3fc82
2017-05-11 13:26:07 +08:00
Boris Chiou 1e2c865691 Bug 1334036 - Part 5: Implement FFI for finding properties overriding animations. r=birtles,emilio
We need to traverse rule tree to get the important rules, so we will not
override them if they have animations running on compositor.

MozReview-Commit-ID: 67NO2nIcUfq

--HG--
extra : rebase_source : 24a4ea4ca10e00f409d94c81acacb3db72248b3f
2017-05-19 15:58:47 +08:00
Boris Chiou c13897d8fe Bug 1334036 - Part 4: Remove unused UpdateCascadeResults function. r=birtles,hiro
We don't use the public UpdateCascadeResults method, so remove it.

MozReview-Commit-ID: A2lWZaHWHTZ

--HG--
extra : rebase_source : 35a1d77fdeba5a1db74d15f523dba78801b0b48e
2017-05-10 13:46:36 +08:00
Boris Chiou f1f6a5d9dc Bug 1334036 - Part 3: Add a flag to represent we are in pre-traversal. r=birtles
We need this flag to avoid assertion in PostRestyleForAnimation(), which
may be called from MaybeUpdateCascadeResults() in pre-traversal.

MozReview-Commit-ID: 46AfoIUb9o3

--HG--
extra : rebase_source : 3290d9954be43ffaeb94b501ac346622651c452a
2017-05-11 13:08:35 +08:00
Emilio Cobos Álvarez 8b2a66ab16 Bug 1364412: Convert pseudo-elements to an enum. r=hiro,xidorn
This allows us to access metadata using `match` instead of comparison with
atoms, which makes it doable to get the pseudo-element flags in the future.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>

MozReview-Commit-ID: KgGjFePmhyS
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>

--HG--
extra : rebase_source : 57614aed13d2c088fe129ecf3fabf9869d5a6d50
2017-05-14 18:39:22 +02:00
Hiroyuki Ikezoe d8fafebff7 Bug 1360776 - Pass AnimationValueMap raw pointer instead of Arc to Gecko_GetAnimationRule(). r=emilio
MozReview-Commit-ID: 5o8NuJolG2R

--HG--
extra : rebase_source : 13d732112dfe5614a83657c7bf7703944050c0f4
2017-05-01 18:45:41 +09:00
Cameron McCormack 73701ced74 Bug 1351535 - Part 5: Add EffectCompositor method to pre-traverse within a specific subtree. r=hiro
It's not great that we traverse up the tree looking for the subtree root for
each animating element that is in mElementsToRestyle.  An alternative could
be to traverse the entire subtree and build a hash set of the elements
within it, so that each test in the mElementsToRestyle loop can be done
quickly.  I suspect that most of the time looking up the tree for
each animation will be quicker, but it does have worse worst case behavior.

MozReview-Commit-ID: FWoQ7fD9YZC

--HG--
extra : rebase_source : 688a19f61e3eda9e84228b6f18913e1f4bb09f13
2017-04-04 19:12:54 +08:00
Hiroyuki Ikezoe 3183fa83ee Bug 1350754 - Templatize EffectCompositor::UpdateEffectProperties. r=birtles
We will use this function for stylo computed values as well.

MozReview-Commit-ID: IxDg4EZARi3

--HG--
extra : rebase_source : dc6445ab0c836393913d64313c8151f31cd7b523
2017-03-27 19:43:04 +09:00
Hiroyuki Ikezoe cb4ce7109c Bug 1340958 - Drop AnimationRule and ServoAnimationRule. r=boris
MozReview-Commit-ID: ClnvyShHpsN

--HG--
extra : rebase_source : c554550264bfedafbf91ed2ed754603fb5c3e4c6
2017-03-17 13:24:42 +09:00
Hiroyuki Ikezoe 3b9f585232 Bug 1340958 - Put computed values into AnimationValueMap instead of hashtable in gecko. r=heycam
Before this patch, we store each computed values in a hashtable,
nsRefPtrHashtable<nsUint32HashKey, RawServoAnimationValue>, for all
KeyframeEffectReadOnly on an element, and convert the ServoAnimationValues of
the hashtable into an nsTArray<ServoAnimationValue*> and then convert
the ServoAnimationValues of the nsTArray into PropertyDeclarationBlock
in rust.  This way was really inefficient.
In this patch, we store the computed values into AnimationValueMap and
convert all AnimationValue in the map into PropertyDeclarationBlock
after EffectCompositor::GetAnimationRule.

MozReview-Commit-ID: EJ2Kl65fVeF

--HG--
extra : rebase_source : e30a9d440dc9855e21b94501b07a3501d31bc345
2017-03-17 13:23:21 +09:00
Boris Chiou 2e1fa78918 Bug 1339704 - Part 2 - Filter out unwanted CascadeLevel::Transitions. r=birtles,hiro
We always call TElement::get_animation_rules() for both cascade levels while
there are animations or transitions, so we want to handle the following cases:
1. Have both CascadeLevel::Animations and CascadeLevel::Transitions:
  * We use EffectSet::mPropertiesForAnimationsLevel to filter out
    CascadeLevel::Transitions because transitions are suppressed when both
    are presented.
2. Have CascadeLevel::Animations, but don't have CascadeLevel::Transitions:
  * We also use EffectSet::mPropertiesForAnimationsLevel to filter out
    the unwanted CascadeLevel::Transitions.
3. Don't Have CascadeLevel::Animations, but have CascadeLevel::Transitions:
  * EffectSet::mPropertiesForAnimationsLevel doesn't work for this case.
    In Gecko, mElementsToRestyle can help us to filter out the unwanted
    CascadeLevel::Animations, However, mElementsToRestyle is cleared in
    Pre-Traversal, so now we rely on the cascade ordering of transitions to
    override animations. I think we still need to optimize this eventually.
4. No animations:
  * EffectSet helps us to check if there is any animations/transitions.

Therefore, we need to call MaybeUpdateCascadeResults(), which updates
mPropertiesForAnimationsLevel, in Pre-Traversal.

MozReview-Commit-ID: IHYw56EX7Ta

--HG--
extra : rebase_source : 4d5eb1335cdce9bf54c9646db1fba72ca3f2c70b
2017-03-13 21:09:50 +08:00
Hiroyuki Ikezoe 11184fb1e8 Bug 1341985 - Trigger the second traversal for updating CSS animations in the case of Servo_ResolveStyleLazily. r=heycam
MozReview-Commit-ID: 7E4unP9M7FQ

--HG--
extra : rebase_source : ee43d00ab84bcd6071ee7bb4cc1de4438229ea1b
2017-03-10 11:53:19 +09:00
Hiroyuki Ikezoe 843466ec0d Bug 1341985 - Trigger the second traversal for updating CSS animations. r=birtles,heycam
The restyle request during restyling is a result of creating/updating/removing
CSS animations that will come from a SequentialTask which will be implemented
in a subsequent patch.

MozReview-Commit-ID: JoAqvcN3y51

--HG--
extra : rebase_source : fdff59771b81518509dfd52e73d3f63ddb82390d
2017-03-10 11:53:19 +09:00