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

309 Коммитов

Автор SHA1 Сообщение Дата
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
Hiroyuki Ikezoe 212fa4884a 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-27 09:26:51 +00:00
Hiroyuki Ikezoe dec4d0e964 Bug 1506988 - Don't incorporate properties that are prevented from running on the compositor in GetPropertiesForCompositor. r=birtles
Now we no longer update the corresponding display items for the animations that
are prevented from running on the compositor if the animations themselves don't
generate any change hints, e.g the same value is specified in both 'from' and
'to' keyframes.  So that we can enable the reftests that we had been suffering
from continuous MozAfterPaint events.

Depends on D12397

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

--HG--
extra : moz-landing-system : lando
2018-11-22 03:57:59 +00:00
Hiroyuki Ikezoe 852cca0069 Bug 1506988 - Move IsMatchForCompositor to KeyframeEffect. r=birtles
So that we can use for KeyframeEffect::GetPropertiesForCompositor().

Depends on D12396

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

--HG--
extra : moz-landing-system : lando
2018-11-22 04:01:10 +00:00
Hiroyuki Ikezoe e74997c54d Bug 1504929 - Factor out IsEffectiveProperty(). r=birtles
Depends on D11598

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

--HG--
extra : moz-landing-system : lando
2018-11-13 10:18:09 +00:00
Hiroyuki Ikezoe e8d577185d Bug 1504929 - Make `if` conditions in KeyframeEffect::GetEffectiveAnimationOfProperty negative. r=birtles
I.e., continue the loop if the CSS property is not what we want and set the
result value only if the CSS property is effective.

This change makes the function match
what KeyframeEffect::GetEffectiveAnimationProperties does in the similar loop
so that we can unify the iteration into a single function in the next commit.

Depends on D11597

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

--HG--
extra : moz-landing-system : lando
2018-11-13 10:17:56 +00:00
Hiroyuki Ikezoe 163ee505df Bug 1504929 - Avoid hashmap lookups in nsLayoutUtils::HasEffectiveAnimation and EffectCompositor::FindAnimationsForCompositor. r=birtles
Depends on D11427

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

--HG--
extra : moz-landing-system : lando
2018-11-13 10:17:44 +00:00
Hiroyuki Ikezoe 8ee7bcc4a7 Bug 1504929 - Stop iterating EffectSets and KeyframeEffect::mProperties for each CSS properties that can be animated on the compositor. r=birtles
This change gets all effective CSS properties on an nsIFrame just once.

Note that LayerAnimationInfo::GetCSSPropertiesFor intentionally returns
nsCSSPropertyIDSet instead of nsCSSPropertyID since when we support individual
transform properties for the compositor the mapping between display item types
and nsCSSProperty has to be 1:N. E.g. all scale/translate/rotate properties are
mapped to transform display item.

Depends on D11424

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

--HG--
extra : moz-landing-system : lando
2018-11-13 10:22:26 +00:00
Hiroyuki Ikezoe 330ed0810b Bug 1479173 - Check animation generation change in the mProperties loop and drop LayerAnimationInfo::sRecords loop. r=birtles
If mIsRunningOnCompositor is true, the property is effective state because
CanThrottle() is called in advance of a restyle for the effect so that we can
drop the check and drop skipping in the case of non-effective properties.

Depends on D10694

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

--HG--
extra : moz-landing-system : lando
2018-11-06 21:02:18 +00:00
Hiroyuki Ikezoe 217607fd0b Bug 1479173 - Call EffectSet::GetEffectSet in CanThrottle just once. r=birtles
Depends on D10693

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

--HG--
extra : moz-landing-system : lando
2018-11-06 21:02:06 +00:00
Hiroyuki Ikezoe 319493d9fc Bug 1479173 - Check mIsRunningOnCompositor flag before iterating LayerAnimationInfo. r=birtles
The comment there was wrong.  We just bail out from there only if
mIsRunningCompositor is false, so it doesn't matter whatever the layer
generation check results.  (i.e., we don't bail out in the case where
mIsRunningCompositor is true).

Also, we iterate over mProperties in the LayerAnimationInfo::sRecords loop
through HasEffectiveAnimationOfProperty, so it doesn't matter that we iterate
mProperties before the loop either.  We will avoid the iteration in the sRecords
loop in a subsequent patch in this series.

Depends on D10692

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

--HG--
extra : moz-landing-system : lando
2018-11-06 21:01:50 +00:00
Hiroyuki Ikezoe 2d705fdae9 Bug 1479173 - Rename LayerAnimationInto::mLayerType to LayerAnimationInfo::mDisplayitemType. r=birtles
In the case of WebRender there is no layers, but actually we'd been using it for
WebRender too, that's confusing.

Depends on D10689

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

--HG--
extra : moz-landing-system : lando
2018-11-06 21:01:15 +00:00
Margareta Eliza Balazs 4aa3a7d442 Backed out 9 changesets (bug 1479173) for build failures in src/dom/animation/EffectCompositor.cpp CLOSED TREE
Backed out changeset 439ac5cfbced (bug 1479173)
Backed out changeset 73aba16a223f (bug 1479173)
Backed out changeset 89dbc6f7f959 (bug 1479173)
Backed out changeset ed1c344ccf0d (bug 1479173)
Backed out changeset c330e7e1eb1d (bug 1479173)
Backed out changeset efcbbb9daa39 (bug 1479173)
Backed out changeset 43c6a7863536 (bug 1479173)
Backed out changeset 94f0ae94a02c (bug 1479173)
Backed out changeset 7cf0ad1af067 (bug 1479173)
2018-11-06 12:13:31 +02:00
Hiroyuki Ikezoe 15ac056c3b Bug 1479173 - Check animation generation change in the mProperties loop and drop LayerAnimationInfo::sRecords loop. r=birtles
If mIsRunningOnCompositor is true, the property is effective state because
CanThrottle() is called in advance of a restyle for the effect so that we can
drop the check and drop skipping in the case of non-effective properties.

Depends on D10694

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

--HG--
extra : moz-landing-system : lando
2018-11-06 09:40:39 +00:00
Hiroyuki Ikezoe 1e3481895b Bug 1479173 - Call EffectSet::GetEffectSet in CanThrottle just once. r=birtles
Depends on D10693

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

--HG--
extra : moz-landing-system : lando
2018-11-06 06:21:14 +00:00
Hiroyuki Ikezoe 92464c401a Bug 1479173 - Check mIsRunningOnCompositor flag before iterating LayerAnimationInfo. r=birtles
The comment there was wrong.  We just bail out from there only if
mIsRunningCompositor is false, so it doesn't matter whatever the layer
generation check results.  (i.e., we don't bail out in the case where
mIsRunningCompositor is true).

Also, we iterate over mProperties in the LayerAnimationInfo::sRecords loop
through HasEffectiveAnimationOfProperty, so it doesn't matter that we iterate
mProperties before the loop either.  We will avoid the iteration in the sRecords
loop in a subsequent patch in this series.

Depends on D10692

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

--HG--
extra : moz-landing-system : lando
2018-11-06 06:21:12 +00:00