Commit Graph

324 Commits

Author SHA1 Message Date
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
050372ea8e Bug 1253476 - Don't composite removed animations; r=boris
Differential Revision: https://phabricator.services.mozilla.com/D30324

--HG--
extra : moz-landing-system : lando
2019-05-20 05:55:52 +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
Brian Birtles
aa1c523b1b Bug 1253476 - Add KeyframeEffect::GetPropertySet; r=boris
Differential Revision: https://phabricator.services.mozilla.com/D30321

--HG--
extra : moz-landing-system : lando
2019-05-20 05:48:31 +00:00
Masayuki Nakano
36e5df54ec Bug 1547621 - Move all inline methods of nsIPresShell into mozilla::PresShell r=smaug
And also this patch moves some related methods which use the inline methods
and member variables used only by them.

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

--HG--
rename : layout/base/nsIPresShellInlines.h => layout/base/PresShellInlines.h
extra : moz-landing-system : lando
2019-04-30 01:52:53 +00:00
Brian Birtles
7a10d13a65 Bug 1541767 - Don't post animation restyles when unbinding an element; r=hiro
Currently we avoid posting animation restyles when unbinding an element by
removing the element from the document before deleting its animation
collections. As a result, when canceled animations go to post a restyle, they
can't find a pres context and give up posting a restyle.

However, this is problematic for two reasons:

* It means we can't remove such canceled animations from the
  PendingAnimationTracker if they are present there (i.e. it regresses the fix
  from bug 1223445).

* It means we can't post cancel events for such animations/transitions since we
  can't lookup the appropriate AnimationEventDispatcher.

In the next patch in this series we will change that order to fix the above
problems but before we do that, we need to introduce another mechanism to make
sure that we don't post restyles when unbinding an element or else we will
regress bug 1396041.

This patch does that by introducing a flag which causes us to not post restyles
when we are doing DOM surgery. For all other cases we actually _do_ need to post
restyles in order to update the style correctly.

Without this patch, layout/style/crashtests/1396041.html would fail after
applying the next patch in this series.

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

--HG--
extra : moz-landing-system : lando
2019-04-18 06:49:25 +00:00
Emilio Cobos Álvarez
d2005aabce Bug 1535788 - add some includes to fix some builds on automation.
CLOSED TREE
2019-04-03 14:22:11 +02:00
Masayuki Nakano
de2d589e58 Bug 1540015 - part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio
This makes `Document::GetShell()` return `PresShell*` instead of `nsIPresShell`.

Additonally, "shell" is unclear ("docshell" vs. "presshell").  Therefore, this
also renames `Document::GetShell()` to `Document::GetPresShell()`.

Similarly, some other method names of `Document` are also renamed from
`*Shell*` to `*PresShell*`.

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

--HG--
extra : moz-landing-system : lando
2019-03-29 15:12:47 +00:00
Masayuki Nakano
b7fbcf781f Bug 1540015 - part 2: Make nsPresContext.h stop including nsIPresShel.h and nsIPresShellInlines.h r=smaug
`*Inlines.h` shouldn't be included by another header file, but `nsPresContext.h`
does it.  This causes include-hell which blocks the following fix.

Additionally, it causes an include hell between `PresShell.h` vs.
`nsIPresShell.h` and `nsPresContext.h if `Document.h` includes `PresShell.h`.
Therefore, this patch also solves this include hell with adding
`nsPresContextInlines.h`.

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

--HG--
extra : moz-landing-system : lando
2019-03-29 15:11:22 +00:00
Dorel Luca
5a0fa68b78 Backed out 3 changesets (bug 1540015) for build bustage. CLOSED TREE
Backed out changeset 7b71c9da0214 (bug 1540015)
Backed out changeset 5723ddbc5c44 (bug 1540015)
Backed out changeset 9561d2c36fa5 (bug 1540015)
2019-03-29 16:14:26 +02:00
Masayuki Nakano
9273f25ce2 Bug 1540015 - part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio
This makes `Document::GetShell()` return `PresShell*` instead of `nsIPresShell`.

Additonally, "shell" is unclear ("docshell" vs. "presshell").  Therefore, this
also renames `Document::GetShell()` to `Document::GetPresShell()`.

Similarly, some other method names of `Document` are also renamed from
`*Shell*` to `*PresShell*`.

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

--HG--
extra : moz-landing-system : lando
2019-03-29 13:09:26 +00:00
Masayuki Nakano
2137fa4b14 Bug 1540015 - part 2: Make nsPresContext.h stop including nsIPresShel.h and nsIPresShellInlines.h r=smaug
`*Inlines.h` shouldn't be included by another header file, but `nsPresContext.h`
does it.  This causes include-hell which blocks the following fix.

Additionally, it causes an include hell between `PresShell.h` vs.
`nsIPresShell.h` and `nsPresContext.h if `Document.h` includes `PresShell.h`.
Therefore, this patch also solves this include hell with adding
`nsPresContextInlines.h`.

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

--HG--
extra : moz-landing-system : lando
2019-03-29 12:13:08 +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
Boris Chiou
745b296ad4 Bug 1425837 - Part 9: Throttle transform-like properties animations without 0% or 100% keyframe. r=hiro
We should also throttle other transform-like animations which can run on
the compositor thread, on visibility hidden element without 0% or 100%
keyframe.

Depends on D22568

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

--HG--
extra : moz-landing-system : lando
2019-03-18 18:05:06 +00:00
Boris Chiou
fd0f04e555 Bug 1425837 - Part 7: Drop the hard-code disabling compositor animations on individual transforms. r=hiro,birtles
Drop the hack which prevents individual transform running on the
compositor thread.

Depends on D22566

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

--HG--
extra : moz-landing-system : lando
2019-03-18 18:05:02 +00:00
Brian Birtles
76cea81357 Bug 1518816 - Set the "may have transform animations" flag on the primary frame; r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D23635

--HG--
extra : moz-landing-system : lando
2019-03-18 04:12:23 +00:00
Brian Birtles
15d4d3276b Bug 1518816 - Rework AnimationUtils::EffectSetContainsAnimatedScale to handle looking up the effect set correctly; r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D23284

--HG--
extra : moz-landing-system : lando
2019-03-18 04:12:10 +00:00
Brian Birtles
d9eee97e11 Bug 1518816 - Use the primary frame in KeyframeEffect::CanAnimateTransformOnCompositor; r=hiro
For most of the functions we call on this frame there will be no difference in
result since the transform styles are inherited from the style frame to the
primary frame. However, for Combines3DTransformWithAncestors() at least, which
calls IsCSSTransformed(), the result will differ.

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

--HG--
extra : moz-landing-system : lando
2019-03-18 04:10:49 +00:00
Brian Birtles
8e3d3cbf03 Bug 1518816 - Clarify when and why KeyframeEffect::HasEffectiveAnimationOfPropertySet might return false even when there are effective animations in a property set; r=boris
It took me a long time to understand why
KeyframeEffect::HasEffectiveAnimationOfPropertySet behaved so differently to
KeyframeEffect::HasAnimationOfPropertySet. This patch attempts to clarify that
while making KeyframeEffect::HasEffectiveAnimationOnPropertySet a little more
generally useful. This will allow us to tidy up the various animation checks in
nsLayoutUtils later in this patch series.

Ultimately, however, we should make this check part of the regular compositor
animation vetting machinery in bug 1534884. That should remove a number of
inconsistencies such that we don't need the extended comments added in this
patch.

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

--HG--
extra : moz-landing-system : lando
2019-03-18 04:10:10 +00:00
Brian Birtles
8ed54f03c6 Bug 1527210 - Drop KeyframeEffect::MaybeUpdateFrameForCompositor; r=hiro
Since bug 1524480 we set the NS_FRAME_MAY_BE_TRANSFORMED frame bit when needed
in RestyleManager::ProcessRestyledFrames so that it is now redundant to also set
it from KeyframeEffect.

Furthermore, setting frame bits from KeyframeEffect is a little fragile since it
depends on the life cycle of the KeyframeEffect which is independent of the
nsFrame. If we can avoid doing that, we probably should.

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

--HG--
extra : moz-landing-system : lando
2019-03-05 03:09:48 +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
Ryan Hunt
00e98538aa Bug 1523969 part 6 - Move method definition inline comments to new line in 'dom/'. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D21106

--HG--
extra : rebase_source : ea3f51c2c11247114deccbc86e90fb02b8a97257
2019-02-25 16:05:29 -06:00
Boris Chiou
542cdbc4f0 Bug 1529422 - Part 2: Let GetScaleValue support individual transforms. r=hiro,emilio
So we can let KeyframeEffect::ContainsAnimatedScale check individual
transforms, which is used by ActiveLayerTracker.

Depends on D19631

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

--HG--
extra : moz-landing-system : lando
2019-02-24 03:27:51 +00:00
Boris Chiou
cc43fb306a Bug 1529422 - Part 1: Add all transform-like properties into ActiveLayerTracker. r=hiro,mattwoodrow
Let ActiveLayerTracker track individual transforms. (Will add
motion-path in the future.)

Besides, using a property set for transform and opacity is more efficient,
so let's change it. For background position, we use a different code path,
so we can have more restrictions in IsStyleAnimated.

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

--HG--
extra : moz-landing-system : lando
2019-02-23 00:21:45 +00:00
Brian Birtles
540858a5b1 Bug 1528883 - Rename CSSPseudoElement.parentElement to CSSPseudoElement.element; r=bzbarsky
As per CSSWG resolution:

  https://github.com/w3c/csswg-drafts/issues/2816#issuecomment-454869173

And corresponding spec change:

  2dbf1e44a6

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

--HG--
extra : moz-landing-system : lando
2019-02-22 03:12:19 +00:00
Boris Chiou
b332718138 Bug 1505225 - Part 1: Make sure we also check the existence of individual transform animations. r=hiro
nsIFrame::BuildDisplayListForStackingContext() will check the existence
of transform animations, so we need to update
nsLayoutUtils::HasAnimationsOfPoperty(). However, checking only
eCSSProperty_transform is not enough. We have to check all the transform-like
properties. Therefore, we update these functions to accept a property
set as the argument, and pass a collection of transform-like properties
into them.

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

--HG--
extra : moz-landing-system : lando
2019-02-20 02:14:39 +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
637401bd0a Bug 1524480 - Make KeyframeEffect::CreateComputedStyleForAnimationValue handle a null elementForResolve; r=hiro
This is unrelated to this bug (the assertion can already fail without the
patches in this patch queue) but I uncovered it while writing the tests in the
next patch which will trip the assertion that is removed in this patch.

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

--HG--
extra : moz-landing-system : lando
2019-02-15 05:54:10 +00:00
Brian Birtles
63a5a6d277 Bug 1524480 - Add a version of KeyframeEffect::GetTargetComputedStyle that does not flush style and use it; r=hiro
A forthcoming spec change will require that Animatable.animate() and other
methods that mutate animations do not flush style:

  https://github.com/w3c/csswg-drafts/issues/3613

Bug 1525809 will add web-platform-tests for this change once it is made (and
tweak the behavior introduced in this patch if necessary).

Currently Firefox and WebKit will flush styles when calling
Animatable.animate(). This is undesirable since this method will _also_
invalidate style. As a result, if content triggers multiple animations in
a single animation frame, it will restyle every time it creates an animation.

This patch removes the style flush from a number of these methods.

In general the style flush is not necessary. For example, we don't need to flush
style before getting the computed style to pass to UpdateProperties. That's
because if there are pending style changes, then UpdateProperties will be called
with the updated style once they are applied anyway. Flushing style first means
that we may end up resolving style twice, when once would be sufficient.

For GetKeyframes() however, when used on a CSS animation, it should return
the most up-to-date style so for that call site we *do* want to flush style.

The test case added in this patch will fail without the code changes in the
patch. Specifically, we will observe 10 non-animation restyles (from the
5 animations) if we flush styles from SetKeyframes.

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

--HG--
extra : moz-landing-system : lando
2019-02-15 06:08:05 +00:00
Brian Birtles
3e2c609d02 Bug 1524480 - Update the cumulative change hint even if a keyframe effect's properties haven't changed if we failed to do so previously because we had no style data; r=hiro
Without this fix, various tests in
dom/animation/tests/mozilla/test_restyles.html will fail once we remove the
style flush from KeyframeEffect::SetKeyframes. That is because we will fail to
set mCumulativeChangeHint correctly when we initially set up the keyframe's
properties and then never update it since UpdateProperties will return early
when it determines the properties have not changed.

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

--HG--
extra : moz-landing-system : lando
2019-02-15 05:51:08 +00:00
Brian Birtles
4bf4b6e949 Bug 1524480 - Unified build fixes for KeyframeEffect.cpp and KeyframeUtils.cpp; r=hiro
Regarding the missing dom:: specifications, presumably this currently works
because in the unified build this file gets combined with something with "using
namespace mozilla::dom" but this will fail if the chunking of the unified build
changes.

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

--HG--
extra : moz-landing-system : lando
2019-02-15 06:05:06 +00:00
Emilio Cobos Álvarez
e38aff2db7 Bug 1525134 - Move image loads out of the style struct accessors. r=heycam
After this I can pass the document from the caller to ResolveSameStructsAs, and
get rid of the pres context pointer.

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

--HG--
extra : moz-landing-system : lando
2019-02-05 19:47:29 +00:00
Razvan Maries
de782903b2 Backed out changeset 919de32d4905 (bug 1525134) for build bustages. CLOSED TREE 2019-02-05 19:36:46 +02:00
Emilio Cobos Álvarez
3fe47839c0 Bug 1525134 - Move image loads out of the style struct accessors. r=heycam
After this I can pass the document from the caller to ResolveSameStructsAs, and
get rid of the pres context pointer.

Differential Revision: https://phabricator.services.mozilla.com/D18600
2019-02-05 18:07:18 +01:00
Razvan Maries
0b09448bc6 Backed out changeset 992f27cfecac (bug 1525134) for build bustages. CLOSED TREE 2019-02-05 18:54:14 +02:00
Emilio Cobos Álvarez
0996652d1a Bug 1525134 - Move image loads out of the style struct accessors. r=heycam
After this I can pass the document from the caller to
ResolveSameStructsAs, and get rid of the pres context pointer.

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

--HG--
extra : moz-landing-system : lando
2019-02-05 13:45:04 +00:00
Brian Birtles
1fd4653bf3 Bug 1518374 - Move a couple of bool members next to each other in KeyframeEffect.h so they can be packed together; r=hiro
Depends on D15901

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

--HG--
extra : moz-landing-system : lando
2019-01-08 06:43:52 +00:00
Brian Birtles
8285a179ca Bug 1518374 - Mark GetKeyframes and GetTargetComputedStyle as const; r=hiro
Depends on D15899

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

--HG--
extra : moz-landing-system : lando
2019-01-08 06:42:17 +00:00
Emilio Cobos Álvarez
d2ed260822 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Emilio Cobos Álvarez
4591031b65 Bug 1513012 - Move overflow to use cbindgen. r=heycam
It's one of the most annoying / hacky mako bits we have.

Differential Revision: https://phabricator.services.mozilla.com/D14084
2018-12-11 03:07:08 +01:00
Brian Birtles
1a15db9fdd Bug 1512678 - Simplify handling of previousBaseStyles in KeyframeEffect::EnsureBaseStyles; r=hiro
This should avoid a sometimes unnecessary heaps allocation and also avoids the
possibility of having a "none" previousBaseStyles.

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

--HG--
extra : moz-landing-system : lando
2018-12-07 17:28:29 +00:00
Brian Birtles
49c3fc1ad2 Bug 1488122 - Factor out type definition for base values hashmap; r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D13935

--HG--
extra : moz-landing-system : lando
2018-12-06 20:57:58 +00:00
Brian Birtles
4646c7c31e Bug 1488122 - Update additive filling animations when the base style changes; r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D13934

--HG--
extra : moz-landing-system : lando
2018-12-06 20:59:50 +00:00
Brian Birtles
7f652e687a Bug 1488122 - Rename KeyframeEffect::mBaseStyleValuesForServo to just mBaseValues; r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D13933

--HG--
extra : moz-landing-system : lando
2018-12-06 20:57:12 +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
22056382c0 Bug 1504065 - Run background-color animations on the compositor. r=birtles
Changes for nsIDOMWindowUtils.getOMTAValue is in the next commit with come test
cases.

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

--HG--
extra : moz-landing-system : lando
2018-11-28 00:58:46 +00:00
Andreea Pavel
f97b59258b Backed out 2 changesets (bug 1504065) for failing Win reftest at child-in-animating-element-display-none.html on a CLOSED TREE
Backed out changeset 129188370231 (bug 1504065)
Backed out changeset 359e81b35cfb (bug 1504065)
2018-11-27 15:33:29 +02:00