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

342 Коммитов

Автор SHA1 Сообщение Дата
Boris Chiou cedb507f58 Bug 1610981 - Drop Maybe<> from KeyframeEffect::mTarget. r=birtles
In order to store the different combinations of (Element, PsuedoStyleType)
pairs, including (nullptr, ::before/::after), we drop Maybe<> and use
OwningAnimationTarget directly.

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

--HG--
extra : moz-landing-system : lando
2020-02-18 20:44:12 +00:00
Hiroyuki Ikezoe 11c48a531c Bug 1615156 - Don't return true from KeyframeEffect::ContainsAnimatedScale if there is no base style. r=boris
The base style is not set in cases where there is no additive/accumulative
animation.

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

--HG--
extra : moz-landing-system : lando
2020-02-13 19:13:39 +00:00
Boris Zbarsky 1395be1f23 Bug 1613013 part 3. Annotate TypeErrors and RangeErrors from WebIDL implementations with the method they come from. r=peterv
Please review the changes to Errors.msg very carefully.  I caught a number of
mistakes there in self-review (e.g. not renumbering replacement markers
correctly when I added {0} to the beginnings of strings), and my confidence
that I caught them all is only middling.

A few lines (MSG_USELESS_SETTIMEOUT, MSG_TYPEDARRAY_IS_DETACHED,
MSG_NOT_SUBMIT_BUTTON) were removed from Errors.msg either because they were
already unused or because they either were single-user constant strings or
became such in the new setup and we could just use the string version of
ThrowTypeError.

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

--HG--
extra : moz-landing-system : lando
2020-02-06 21:22:32 +00:00
Makoto Kato 7574b8612d Bug 1503656 - Part 1. Always use CssEnvironment from media query's device. r=emilio
Although CssEnvironment is in Device of media query implementation, some code
creates CssEnvironment instance without Device. So I would like always to use it from Device of media query.

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

--HG--
extra : moz-landing-system : lando
2020-01-08 11:55:28 +00:00
Boris Chiou bdd5623ab2 Bug 779598 - Do animations of transforms with preserve-3d at compositor. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D57029

--HG--
extra : moz-landing-system : lando
2019-12-23 09:52:43 +00:00
Gabriele Svelto ace6d1063f Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

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

--HG--
extra : moz-landing-system : lando
2019-12-06 09:24:56 +00:00
Dorel Luca a381d5c96d Backed out changeset f6e53d1c6518 (bug 1600545) for Android build bustage. CLOSED TREE 2019-12-04 17:32:27 +02:00
Gabriele Svelto bc9290f767 Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

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

--HG--
extra : moz-landing-system : lando
2019-12-04 15:01:19 +00:00
Mirko Brodesser b2de103bf9 Bug 1593222: part 12) Rename "nsNodeUtils.*" to "MutationObservers.*". r=smaug
Depends on D51827

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

--HG--
rename : dom/base/nsNodeUtils.cpp => dom/base/MutationObservers.cpp
rename : dom/base/nsNodeUtils.h => dom/base/MutationObservers.h
extra : moz-landing-system : lando
2019-11-06 09:08:06 +00:00
Mirko Brodesser 4807f484fc Bug 1593222: part 10) Move `Animation*` methods to `MutationObservers`. r=smaug
Depends on D51825

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

--HG--
extra : moz-landing-system : lando
2019-11-05 20:39:22 +00:00
Boris Chiou d77411c397 Bug 1429305 - Enable OMTA for motion path and add some tests for it. r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D50015

--HG--
extra : moz-landing-system : lando
2019-10-31 21:16:35 +00:00
Hiroyuki Ikezoe e198ba4111 Bug 1585770 - Copy KeyframeEffect::mBaseStyle in the KeyframeEffect copy constructor. r=boris
The original test case doesn't crash reliably but the test case in this commit
crashes 100% locally without this fix.

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

--HG--
extra : moz-landing-system : lando
2019-10-03 20:00:27 +00:00
Boris Chiou 470629b5d3 Bug 1567330 - Add offset shorthand. r=emilio,birtles
Also, update the serialization by the shorter perference because this is
a new feature and using older syntax doesn't make sense.

Besides, use `cssOffset` for web animation IDL attribute name.

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

--HG--
extra : moz-landing-system : lando
2019-09-23 19:56:33 +00:00
Emilio Cobos Álvarez 70b6fda902 Bug 1575926 - Check that we have a target in CalculateCumulativeChangeHint. r=hiro
Seems we'll update the change hint properly via SetTarget if we get a new
target.

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

--HG--
extra : moz-landing-system : lando
2019-08-26 09:08:22 +00:00
kriswright 8c68307d03 Bug 1573268 - Convert two layers.offmainthreadcomposition.* prefs to static prefs. r=njn
Converts layers.offmainthreadcomposition.async-animations and layers.offmainthreadcomposition.log-animations to their respective static prefs. Since all IsAnimationLoggingEnabled() did was create a pref and return the variable sShouldLog, this function is removed and replaced with the static pref.

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

--HG--
extra : moz-landing-system : lando
2019-08-13 00:02:12 +00:00
Boris Chiou c4f468de6a Bug 1569795 - Block compositor animations of transform-like properties if offset-path is not none. r=hiro
The animations of motion path are not running on the compositor, and the
properties in [motion-1] is not part of transform-like properties (i.e.
nsCSSProperties::TransformLikeProperties()) for now, so we should run
transform animations on the main thread if offset-path is not `none`.

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

--HG--
extra : moz-landing-system : lando
2019-08-01 21:22:49 +00:00
Nicholas Nethercote 18fae65f38 Bug 1563139 - Remove StaticPrefs.h. r=glandium
This requires replacing inclusions of it with inclusions of more specific prefs
files.

The exception is that StaticPrefsAll.h, which is equivalent to StaticPrefs.h,
and is used in `Codegen.py` because doing something smarter is tricky and
suitable for a follow-up. As a result, any change to StaticPrefList.yaml will
still trigger recompilation of all the generated DOM bindings files, but that's
still a big improvement over trigger recompilation of every file that uses
static prefs.

Most of the changes in this commit are very boring. The only changes that are
not boring are modules/libpref/*, Codegen.py, and ServoBindings.toml.

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

--HG--
extra : moz-landing-system : lando
2019-07-26 01:10:23 +00:00
Boris Chiou b5a2513e31 Bug 1534884 - Add new animation warning for animations overridden by important rules. r=birtles
We move the check of important rule and animation level into
KeyframeEffect::ShouldBlockAsyncTransformAnimations(), and add a new warning
for it.

Note:
1. ShouldBlockAsyncTransformAnimations() only cares about transforms. And
   for other compositor animation properties, we count on
   HasEffectiveAnimationOfPropertySet() (in IsMatchForCompositor()).
2. If we check the important rules in both
   EffectCompositor::HasAnimationsForCompositor() and
   ActiveLayerTracker::IsTransformMaybeAnimated(), we may get the incorrect
   animation warnings (i.e. TransformFrameInactive). In most cases, we
   check these two functions together, so perhaps move the check of important
   rules outside HasEffectiveAnimationOfPropertySet() is fine.
   Besides, ActiveLayerTracker just tracks if there is a style change on this
   property (or display item) on the active layers, so should be OK to not
   check important rules in it.

So IsMatchForCompositor() should check all transform-like properties,
instead of each one, to get the correct result. (That's why we have to
refactor KeyframeEffect::GetPropertiesForCompositor() as well.)

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

--HG--
extra : moz-landing-system : lando
2019-06-28 18:18:08 +00:00
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