Use [SetterThrows] for KeyframeEffect.spacing because it throws if the input
string is not conformed to the grammar.
MozReview-Commit-ID: CkAnPu8TnV
--HG--
extra : rebase_source : af0960391684323a25ac0b40da28dcbe5c3c2919
I came across these while working on a different bug that changed the grouping
in the unified build. Adding these as a separate step will hopefully remove a
little noise from the next patch in the series.
MozReview-Commit-ID: Km7wTcVWG9n
--HG--
extra : rebase_source : 0610add67482c1a5aa7c4f576e151ed9437698c0
After updating a new animation, I think we don't need to request a restyle for
the new animation because:
1. CSS Animation & CSS Transition: we don't need to request a restyle.
2. Animation constructor: we don't need to request a restyle.
2. Animation.effect: we call PostUpdate() after SetEffectNoUpdate() already.
MozReview-Commit-ID: HrUGBrbt7xi
--HG--
extra : rebase_source : 0c2574be26bade3b17a31da361d24333f6409689
We mark the cascade update many times, so it's better to factor it out.
MozReview-Commit-ID: HbE980gOJ9M
--HG--
extra : rebase_source : a76dfc489f378c5bd7e711f296d0599ecf2322c5
The purpose of ResetWinsInCascade() in SetTarget() ensures that
RequestRestyle(Layer) is invoked for the new target in the case when
composite order or CSS cascading or order is changed due to chaging target
element, but RequestRestyle(Layer) will be called right after setting
the new target in SetTarget() explicitly.
MozReview-Commit-ID: 1cFJCAEEroP
--HG--
extra : rebase_source : c3008ef15d0328466f77015020c5148ef2ad07c6
Move the mTiming, mAnimation, and the implementaion of timing into
AnimationEffectReadOnly.
MozReview-Commit-ID: EZhlbphVvCo
--HG--
extra : rebase_source : 4aa4821304671a8dfc6feb047ab20b26ef2d6b11
This implements the spec change in 21de090dac
The spec change refers to a binary 'animation direction' flag. Instead of that,
however, we just pass the playback rate along and use it inside
GetComputedTimingAt since this seems simpler.
Also, this patch moves the implementation of
KeyframeEffectReadOnly::GetComputedTiming from the header file into the .cpp
file. This is because with this change, GetComputedTiming needs to call
mAnimation->PlaybackRate() and so mozilla::dom::Animation needs to be a complete
type. However, simply including Animation.h doesn't work because of a cyclic
dependency between KeyframeEffect.h and Animation.h. We might be able to fix
this later but since yet-to-land bug 1049975 moves this code around a lot, I'd
rather not touch it too much just now.
MozReview-Commit-ID: 1h6XRh4xmfI
This implements the spec change in 21de090dac
The spec change refers to a binary 'animation direction' flag. Instead of that,
however, we just pass the playback rate along and use it inside
GetComputedTimingAt since this seems simpler.
Also, this patch moves the implementation of
KeyframeEffectReadOnly::GetComputedTiming from the header file into the .cpp
file. This is because with this change, GetComputedTiming needs to call
mAnimation->PlaybackRate() and so mozilla::dom::Animation needs to be a complete
type. However, simply including Animation.h doesn't work because of a cyclic
dependency between KeyframeEffect.h and Animation.h. We might be able to fix
this later but since yet-to-land bug 1049975 moves this code around a lot, I'd
rather not touch it too much just now.
MozReview-Commit-ID: 1h6XRh4xmfI
The previous patch in this series renamed nsCSSProperty to nsCSSPropertyID.
This patch renames nsCSSPropertySet to nsCSSPropertyIDSet accordingly.
This patch is generated by the following commands (note: if you're running
using OS X's sed, which accepts slightly different flags, you'll have to
specify an actual backup suffix in -i, or use gsed from Homebrew):
hg stat -c \
| cut -c 3- \
| tr '\n' '\0' \
| xargs -0 -P 8 gsed --follow-symlinks 's/\bnsCSSPropertySet\b/nsCSSPropertyIDSet/g' -i''
Then:
hg mv layout/style/nsCSSPropertySet.h layout/style/nsCSSPropertyIDSet.h
... and finally, manually renaming nsCSSPropertySet in the include guard in
nsCSSPropertyIDSet.h.
MozReview-Commit-ID: ASUNs7FWbKP
--HG--
rename : layout/style/nsCSSPropertySet.h => layout/style/nsCSSPropertyIDSet.h
This patch is generated by the following commands (note: if you're running
using OS X's sed, which accepts slightly different flags, you'll have to
specify an actual backup suffix in -i, or use gsed from Homebrew):
hg stat -c \
| cut -c 3- \
| tr '\n' '\0' \
| xargs -0 -P 8 gsed --follow-symlinks 's/\bnsCSSProperty\b/nsCSSPropertyID/g' -i''
Then:
hg mv layout/style/nsCSSProperty.h layout/style/nsCSSPropertyID.h
... and finally, manually renaming nsCSSProperty in the include guard in
nsCSSProperty.h.
MozReview-Commit-ID: ZV6jyvmLfA
--HG--
rename : layout/style/nsCSSProperty.h => layout/style/nsCSSPropertyID.h
We don't actually need to re-calculate if the updated properties are the
same as the old one. This change avoids problematic nested calls of
nsStyleSet::GetContext() in particular cases.
MozReview-Commit-ID: JksiTGX57Fy
Previously, when fetching an nsPresShell, we would look up the current realm
document and get the pres shell for it. This patch makes us call GetPresShell()
which uses GetRenderedDocument() which corresponds to the composed document of
the target effect which seems more consistent since it is the target effect we
will use as context for computing CSS values (as required by [1]).
[1] https://w3c.github.io/web-animations/#calculating-computed-keyframes
MozReview-Commit-ID: 9S55041rfTp
--HG--
extra : rebase_source : c52d4c366d0a2891958c8f7378614a8feb5e7c70
Note that when we actually compute values, we will use the composed document of
the target element (see the next patch in this series).
MozReview-Commit-ID: 8Pp3y19pltP
--HG--
extra : rebase_source : bb1c21f3fdcf2e831213d2f278d70e4ca2637028
We already have a wrapper named nsIFrame::BackfaceIsHidden().
MozReview-Commit-ID: 5L49W6wtXs1
--HG--
extra : rebase_source : d3be8d028453e63fb2d3d96b5956262d352385ef
This implements the changes to the specified behavior from the following
changeset:
a9ba51338e
It also updates test expectations based on the tests updated in part 1 of this
patch series.
MozReview-Commit-ID: HyJC8tHXLYc
--HG--
extra : rebase_source : 6d0f5eb03a2bb4c3938d79dfae7ee433d33fd2b1
Handle these cases:
1. When creating null-target effect whose spacing mode is "paced":
- Fall back to distribute spacing. This case is already included by previous
patches.
2. When setting a target to null:
- Apply distribute spacing.
3. When style context is null.
- Fall back to distribute spacing.
4. When setting a new valid target:
- Use this new target as the context element and re-calculate the computed
offsets. This case is already included by previous patches.
MozReview-Commit-ID: 1zhSOAylnZb
--HG--
extra : rebase_source : e2988f433f395a398090dc08f262b0154de3dc50
Do a simple refactor, so we can reuse the getter of nsStyleContext.
MozReview-Commit-ID: 4BQ7f8HuFns
--HG--
extra : rebase_source : 37bbf6af795484c5d80d308683e4fcdfe23c7a1a
Calculate the paced spacing for each Keyframes by the context element. Use the
algorithm in the spec.
MozReview-Commit-ID: HFWQwoKhKWt
--HG--
extra : rebase_source : 40112eb1f722179cfc0a4ccbd188e22bc7af9b9b
We want to reuse the StyleAnimationValues of properties of each keyframe when
applying spacing and building animation property segments, so refactor this
part.
MozReview-Commit-ID: 8G56C3BU3FR
--HG--
extra : rebase_source : 73b6d374ac8bd25645d1b1b2f15f4e778b3ec949
When we apply paced spacing, we have to check if there are still null computed
offsets after applying paced spacing to paceable Keyframes because the
calculation of distance may be failed or some Keyframes are not paceable in
the specific range. Therefore, using -1 would be easier to check it.
Also, add a const, kComputedOffsetNotSet, to represent this invalid value.
MozReview-Commit-ID: GPhj7cdiX2W
--HG--
extra : rebase_source : 8c4e7769c454fe50eb1cc08db63866dcc4ed62e5
Rename it to ApplySpacing, and let it handle both distribute and paced mode.
MozReview-Commit-ID: 2kGA6LMHUsz
--HG--
extra : rebase_source : ebd5566392b1ea6a4a445ff7c3ed81cdc94bdded
We only support spacing mode from Web Animations API, so add a simple parser and
use it only from the API. In this patch, parse spacing mode from the constructor
and throw TypeError if we have any parse error.
MozReview-Commit-ID: 9H7g80IcZfZ
--HG--
extra : rebase_source : e1bc781ff0f20a1a38c04e672832ec013edc549d
Add a new file, KeyframeEffectParams.h, and define the basic data
members nsString for the spacing mode.
Also, add one more argument, const KeyframeEffectParams&, to the
constructors of KeyframeEffect(ReadOnly).
MozReview-Commit-ID: I7LYlnv6LLb
--HG--
extra : rebase_source : 9aebb7b9659588674c2a954eb2ce62c827bc9830
In order to raise an assertion in CanIgnoreIfNotVisible() which will be
introduced in part 3 when the cumulative hint is not properly, we should skip
the calculation when mProperties is empty.
Rather than defining the same type redundantly but with a name that overlaps
with a struct in KeyframeEffect.h (that has a different type).
MozReview-Commit-ID: 3MbvXWL8XlL