Otherwise, if getKeyframes() returns an empty array, we don't check each keyframes
at all.
MozReview-Commit-ID: LSBIgetZq2G
--HG--
extra : rebase_source : cc24d093a1e0c9223ac696e44d297602016189a2
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
If we don't increment the reference count for the Atom in servo side, it's
possible to try to release the Atom in servo side even if we have already
released in gecko side. When it happens, nsIAtom::mKind is no longer reliable.
MozReview-Commit-ID: GrxbcYxowRB
--HG--
extra : rebase_source : 94e054e3357b31e398e8e5e81522dab3019c561c
The SchedulePaint() ends up calling
nsSVGEffects::InvalidateDirectRenderingObservers, it doesn't need for retained
display list, and causes harmful restyle events for stylo.
We will call ScheulePaint without involing InvalidateDirectRenderingObservers
later in another bug.
MozReview-Commit-ID: 10V9JLHZmCs
--HG--
extra : rebase_source : 664718eb91e973a4619847e4bfa94327e410f364
The overall progress is factored in iteration start, so even if
TimingParams.mIterations is less than UINT64_MAX, it will exceed UINT64_MAX.
MozReview-Commit-ID: CEOYAGsCoIE
--HG--
extra : rebase_source : 54ed450ebd0218ee2cac9f27125601c6575ee1a5
Because our ComputedTiming.mCurrentIteration is uint64_t.
MozReview-Commit-ID: FjbhEvTUMr4
--HG--
extra : rebase_source : d8ba72c914aac6661f0a5a21885505f94844ce38
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
Automation also uses env vars to change the Stylo mode, so reading the pref is
not enough. Change the test to `isStyledByServo` which covers all cases.
MozReview-Commit-ID: KLh42b4roF4
--HG--
extra : rebase_source : f77e78694d00489d4e5c7d7f4eaffca0610f128a
Replace it with NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION, because it
has been the same for a while.
MozReview-Commit-ID: 5agRGFyUry1
--HG--
extra : rebase_source : 5388c56b2f6905c6ef969150f0c5b77bf247624d
This test called waitForPaints() after creating an animation, but waitForPaints()
didn't wait for a MozAfterPaint event actually since
DOMWindowUtils.IsMozAfterPaintPending which is checked a MozAfterPaint event has
been queued return false[1]. (i.e. This test didn't wait for a MozAfterPaint)
This is related to bug 1341294. If gecko can receive a MozAfterPaint
corresponded to own paint, waitForPaint() does not need to check for
DOMWindowUtils.IsMozAfterPaintPending.
This patch is a workaround until bug 1341294 is resolved.
[1] http://searchfox.org/mozilla-central/rev/5696c3e525fc8222674eed6a562f5fcbe804c4c7/testing/mochitest/tests/SimpleTest/paint_listener.js#60
MozReview-Commit-ID: 6Rnv8MBP6Se
--HG--
extra : rebase_source : 052f62b01df819961040f6652954e1068f86fc47
Adopt from Tor #16337.
This patch makes Animation API to report a rounded time when 'privacy.resistFingerprinting'
is true. The Animation API uses AnimationUtils::TimeDurationToDouble() to convert
its time duration into a double value and reports it when someone tries to query
time through Animation API. So, we use nsRFPService::ReduceTimePrecisionAsMSecs()
inside this method to round the time in the scope of the millisecond.
MozReview-Commit-ID: 8o01G6AlAu9
--HG--
extra : rebase_source : e2d52f04c1d63accb786f6cf9b1a102607eed517
We should not be declaring forward declarations for nsString classes directly,
instead we should use nsStringFwd.h. This will make changing the underlying
types easier.
--HG--
extra : rebase_source : b2c7554e8632f078167ff2f609392e63a136c299
This is a temporary step until we implement bug 1391537. It is needed to
maintain consistent behavior with Gecko and provide sensible output,
particularly in the case where we have longhands whose values are drawn from
unparsed shorthands.
MozReview-Commit-ID: 9aD2tsLagBp
--HG--
extra : rebase_source : cdabb26be17b96a574ea8b2e8093e11abb1af430
calc() serialization in stylo changed to align to the spec more closely (modulo percentage order).
See the linked issue.
MozReview-Commit-ID: GyzZvdumMSe
In Servo, the max value for 'translate' is different from normal float since
is using Au ( AppUnit ). The value which we introduced as MAX_AU_PX
( 1.78957e+7 ) in this test is calculated by following mechanis.
1. Like this time, if the value is larger than max float, stored into specified
value as infinity by parsing.
2. Then, when converts to the computed value Au from the specified value
(infinity), ABSOLUTE_LENGTH_MAX (1 << 30) = 1073741824 stores into the Au.
[1]
3. Finally, when get the PX value, returns the value which devided by
AU_PER_PX ( 60 ). This value is 1.78957e+7.
[1] to_au_round() method
https://searchfox.org/mozilla-central/source/servo/components/style/values/specified/length.rs#249
MozReview-Commit-ID: BVfDhOKXaWw
--HG--
extra : rebase_source : e55be1f42d9198c35bb8f29882ff19ec9de8f2fa
The serialization of the value in getKeyframes() on both Gecko and Servo is
different, especially 'initial', 'inherit' and 'unset' on discrete animation.
Gecko returns those value as is, but Servo returns computed value.
We are understanding computed value (Servo) is right, so we change expected
values for them. Also, we skip them if this test is running on Gecko.
MozReview-Commit-ID: 4GFpCpec0eP
--HG--
extra : rebase_source : 8bb9fc670fb7ffd56935cdfb4f038be334782de7
Since we made -moz-appearance animatable, append to the moz prefixed properties
test.
MozReview-Commit-ID: 9tdouU1umEB
--HG--
extra : rebase_source : 79e9639360461452249ce54ff538294f25b6cd4f
From the official link for -moz-force-broken-image:
A value of 1 means that the broken image icon is even shown if the image has
an alt attribute. A value of 0 only displays the alt attribute.
It's really ambiguous how we handle other values. Actually stylo's parser
rejects other values. We should use the valid values for this test.
MozReview-Commit-ID: CzmIvsmauke
--HG--
extra : rebase_source : a6387e07b3578cf811bd17f772d791ec73bfa1e7
Unlike Gecko, Stylo currently invokes a needless RequestRestyle(Standard)
for this test case (bug 1388560). For this reason, the check right after
re-attaching the orphaned element passes accidentally.
MozReview-Commit-ID: JUG1dgMUQEX
--HG--
extra : rebase_source : a86d72a41c160edc30f83d82179ebe1226b842de
Actually we have a chance to run styling process when we attach an orphaned
element to a document in this test setup. Precisely, we can process a restyle
between rAF callbacks and Promise.then() callback for waitForAnimationFrames().
So if we call RequestRestyle(Layer) when we attach the element to the document
(bug 1388557), the animation starts restyling in the first frame. *BUT* this
behavior will also change once our micro tasks handling becomes the HTML spec
compliance (bug 1193394). When the micro tasks handling changes, we should also
fix a bunch of test cases and test utilities in bug 1388557.
MozReview-Commit-ID: GyH1ofGhXOP
--HG--
extra : rebase_source : 3536c315960150960fd43286b205c03c584d53ca
DOMWindowUtils.isStyledByServo checks not only the preference value but also
STYLO_FORCE_ENABLED value. This is important especially when we run test on
our CI. On our CI, the preference value is false but just STYLO_FORCE_ENABLED
is set.
MozReview-Commit-ID: FKEd5LFwcxf
--HG--
extra : rebase_source : 1ffd8a68a8339babed14f441bf2d69c9ffd9e3ee
It has been able to pass on stylo since bug 1376248.
MozReview-Commit-ID: 142ptKlqrHe
--HG--
extra : rebase_source : 3bb601122b1593d87a520d3585cc84c0868d6ac8
This removes about 2/3 of the occurrences of nsXPIDLString in the tree. The
places where nsXPIDLStrings are null-checked are replaced with |rv| checks.
The patch also removes a couple of unused declarations from
nsIStringBundle.idl.
Note that nsStringBundle::GetStringFromNameHelper() was merged into
GetStringFromName(), because they both would have had the same signature.
--HG--
extra : rebase_source : ac40bc31c2a4997f2db0bd5069cc008757a2df6d
Current Gecko does not need this (see bug 1367975 comment 10 for the reason),
but this is the right thing to do for our animation styling machinery
especially for updating animations on the compositor.
MozReview-Commit-ID: H6mgTXMHecG
--HG--
extra : rebase_source : ef2e5127a5c56008771a434cc5c342ebeca1b7be
The KeyframeEffectReadOnly::GetProperties compares AnimationValue's mGecko
member which means it sometimes produces the wrong results when using the Servo
backend. Now that AnimationValue has a suitable operator!= method we can simply
compare the AnimationValues directly.
MozReview-Commit-ID: DQQbmcdeynw
--HG--
extra : rebase_source : 509230cf460308b0a534fe9831e9e0d7fa3b8bee
This test fails without the first patch in this series.
MozReview-Commit-ID: A22aFPnklqj
--HG--
extra : rebase_source : c3a4e1f1dea0444895a3b60c45814c219ff65ac6
Without this mValue may end up looking like a valid nsCSSValue object and bad
things will happen when we try to clone it.
We could just assign mem::zeroed() to mValue but this array hacking on the Servo
side is already pretty nasty and mSimulateComputeValuesFailure would still
remain unassigned (and if we did try to assign it on the Servo side we'd need to
only assign it in debug builds). Unless this proves performance-critical, it's
probably best to just do this on the Gecko side.
MozReview-Commit-ID: 75nFsflhZUM
--HG--
extra : rebase_source : 0e5d94a7f6fdb6768983ba440a3ea69d65cbffbf
Before this refactoring, getComputedStyle could have side effects, and left the
style data in the element, so we could never arrive there without data.
There are a few crashtests that caught this, but this was already broken if you
called animate() on an element deep in a display: none subtree.
MozReview-Commit-ID: 1AvOvhAyOP3
--HG--
extra : rebase_source : 0a920df8809961f784026a14a624d8eafb4cc79f
The previous patch takes the approach that we should simply not add elements in
documents without a pres shell to EffectCompositor's set of elements to restyle.
However, there exists a case where we might have an element in a displayed
document, then we might tickle it so that it requests an animation restyle, and
then move it to a document without a browsing context. In that case we should
skip the element when we next do animation restyles.
However, even if we successfully skip the element in the document without a pres
shell, we need to make sure it eventually gets removed from the set of elements
to restyle rather than simply remaining there forever. For that reason this
patch makes us unconditionally clear the set of elements to restyle whenever we
do a full restyle from the root.
This patch also adds a test case to trigger the scenario outlined in the first
paragraph above. I have confirmed that without the code changes in this patch,
if we simply assert that target.mElement has an associated pres shell in
getNeededRestyleTarget, then that assertion will fail when running this test
case.
MozReview-Commit-ID: ED2X5g39hYZ
--HG--
extra : rebase_source : 06fecc98c25c739d26123bddf1fd0908cf4410e6
extra : source : 12c7a036215a901bf6804c0e9aacd2a9fc20f932
This patch makes us ignore animation restyle requests for elements in documents
without a pres shell made by either:
* Calls to EffectCompositor::RequestRestyle (e.g. by calling Web Animations API
methods on animations that target such elements)
* Calls to EffectCompostior::PreTraverse(dom::Element*, CSSPseudoElementType)
(e.g. by calling getComputedStyle(elem).prop on such an element).
The other overloads of PreTraverse should presumably be called during regular
document restyling where the element is expected to be in a displayed document
and hence we simply assert that that is the case for those methods.
MozReview-Commit-ID: FZD0hKAXYEf
--HG--
extra : rebase_source : 9b9ddf4648b49e0241054ffa51a02ae66f1c5009
Update the various animation restyle tests to check the new animation only data
inside the restyle marker.
MozReview-Commit-ID: HEe8x45IhHj
--HG--
extra : rebase_source : fdaa5855e94d68ce2a70d00fde11582c9a538f45
Since we implement following properties animatable, append to test.
* -moz-border-bottom-colors
* -moz-border-left-colors
* -moz-border-right-colors
* -moz-border-top-colors
MozReview-Commit-ID: E3zWaDcRdtE
--HG--
extra : rebase_source : 27301a4bc354f14cf3f90e8c8271be6022d99721
For this test case, we can't use global '::before' and '::after' selectors
since it changes visiting order for the pseudo elements on updating styles
and leads to different results of observed records.
MozReview-Commit-ID: 4e4eZTmr0gJ
--HG--
extra : rebase_source : f966aef3145e317a81262eaf67f402a80af3a90c
There is no spacing mode any more, so rename this function.
MozReview-Commit-ID: 9DIqKmQnuJo
--HG--
extra : rebase_source : 3600be87a699a1a5fe237f8ed75baf03f0b5ae84
When styling with the Servo backend, we should also use the Servo backend to
determine if a property is animatable or not. However, if we do this,
Servo_Property_IsAnimatable will start returning true for the 'display' property
once we mark that as animatable in Servo (for SMIL).
Even if we later fail to actually animate 'display' (due checks added to Servo
in the next patch) we still need to treat 'display' as un-animatable in
KeyframeUtils so that we don't *read* the 'display' property of Keyframe objects
passed to the Animations API, since that is observable.
This patch makes us consult Servo_Property_IsAnimatable when using the Servo
backend and also explicitly treat the 'display' property as not animatable.
MozReview-Commit-ID: 1JllbeJisAS
--HG--
extra : rebase_source : d73b7d9ee0da03bfed68e574b67e10b342c1868d
According to the spec, when we cancel an animation we should "reset an
animation's pending tasks"[1] which has following step:
...
4. Reject animation’s current ready promise with a DOMException named "AbortError".
5. Let animation’s current ready promise be the result of creating a new resolved Promise object.
Since we create the ready promise and, if need resolve it when we create it
(see Animation::GetReady), this patch simply clear the ready promise
when an animation is canceled.
[1] https://w3c.github.io/web-animations/#reset-an-animations-pending-tasks
MozReview-Commit-ID: JxoqeA5dXCO
--HG--
extra : rebase_source : 1c51724f236b3ed464eb6af3c20ccc9aaf5aa3e6
This tests are to confirm either we could get valid value of 'inherit' of
keyframe.
Also, this tests are for clone_XX methods of stylo as well.
MozReview-Commit-ID: J6HZBRZB5am
--HG--
extra : rebase_source : c8c282f3204d94931112fa9811bb5c51b8fe6992
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
Add this crashtest for interpolation/accumulation on mismatched transform lists
to make sure it doesn't crash and there is no leak because we use
nsCSSValueSharedList, instead of nsCSSValueList_heap, for Servo backend.
MozReview-Commit-ID: 2VdKSQcK7pj
--HG--
extra : rebase_source : f497e442a34f29fb0aa936c012ad7bc14cac2e7a
In subsequent patches, the servo version of KeyframeUtils::ApplySpacing()
changes fifth argument to const ServoComputedValues*. If we still use nullptr
for the fifth argument in caller side, compilers can't determine whether
nsStyleContext* or const ServoComputedValues* should be used.
MozReview-Commit-ID: 1bE2cA7gRdi
--HG--
extra : rebase_source : 230b9b94bbfdcacf1b35a6c8eb1186e22b331047
Test to confirm valid 'inherit' value of -moz prefixed properties during
animation. This also means to confirm the algorithm of clone_XX methods
of stylo.
NOTE: This file should have only animatable properties that have '-moz' prefix.
In this patch, appends following properties.
* -moz-box-align
* -moz-box-direction
* -moz-box-orient
* -moz-box-pack
* -moz-float-edge
* -moz-orient
* -moz-osx-font-smoothing
* -moz-user-focus
* -moz-user-input
* -moz-user-modify
* -moz-window-dragging
MozReview-Commit-ID: GfBfMkvfgGm
--HG--
extra : rebase_source : f2e220ccc0c6864ad15416a2cda470f64eeb62be
We have already waitForIdle() in testcommon.js.
MozReview-Commit-ID: 64XTU2g8CO7
--HG--
extra : rebase_source : 028e6827f4d67b789b979673ceb5a8bef501dbf7
requestIdleCallback has been enable by default in bug 1314959.
MozReview-Commit-ID: 7rwqdsCdjNb
--HG--
extra : rebase_source : cb60996accfe733714c9b5dff983c2210c4fa98b
Remove the unconditional return from FindAnimationsForCompositor(), so
we can check if there is any property running on compositor.
Also, enable a reftest and fix the mochitest expectation:
1. The expectation numbers of test_animations_omta.html in e10s and non-e10s
are different, so skip non-e10s.
2. We pass all tests in test_animations_omta_start.html with e10s;
however, got 3 test failures with non-e10s, so skip this file with
non-e10s.
MozReview-Commit-ID: IuOyAsUYguU
--HG--
extra : rebase_source : 8f8549063f2d1907e95d0bab450e1b6f851f8c84
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
We need to retrieve the correct base style for Servo backend, so change
the return value to AnimationValue and update
KeyframeEffectReadOnly::BaseStyle().
MozReview-Commit-ID: 9FL3h1DLoJt
--HG--
extra : rebase_source : 42284c5fe8b8135910cde44b0815eb475ca2f1cc
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
We don't use the public UpdateCascadeResults method, so remove it.
MozReview-Commit-ID: A2lWZaHWHTZ
--HG--
extra : rebase_source : 35a1d77fdeba5a1db74d15f523dba78801b0b48e
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
We restyle elements with non-animation restyles even if the animations
are throttled.
MozReview-Commit-ID: Exhd4qVx7su
--HG--
extra : rebase_source : 1632bf949bb60a894372a425fd9173e1b718452d
During pre-traversal of EffectCompositor, we call MaybeUpdateCascadeResult(),
which may add new element into mElementsToRestyle, as a result, we may
iterate a mutated mElementsToRestyle. In this patch, we copy the element
which needs update cascade results into another set and traverse this new set
to call MaybeUpdateCascadeResult(). After that, do normal pre-traversal on
mElementsToRestyle.
MozReview-Commit-ID: 3uo6Ec5JNjp
--HG--
extra : rebase_source : 3cdc3c3147f011074a884d85da2655e0ed4a3730
The type of these two members is intended to be boolean. Fix the typo in this
patch.
MozReview-Commit-ID: HcwvUQztw9J
--HG--
extra : amend_source : 59c29156231c9c93f5939afeda1641da72a50489
FRAME_STATE_BIT of nsFrame and nsINode::mBoolFlags are both full, we need to
find another place to hold MAY_HAVE_OPACITY information.
nsINode::mSlots might be a choice, but since we always use this information in
painting, memory footprint of nsINode will become larger after this change.
So I decide to put this information right in EffectSet. The drawback of storing
this information in EffectSet is, although unnecessary Effect look-up is
prevented, we still need EffectSet property look-up in each time
HasOpacityInternal call, so we need Part 2.
Conceptually, Part 1 and Part 2 are independent.
MozReview-Commit-ID: 6sfBFSHjxQb
--HG--
extra : rebase_source : 394141cec3b44bb352297a0add8f9763d815bddb
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
I've propagated quirks mode information on some places. But we needed to pass
quirks mode to some other FFI functions to be able to handle that information
properly.
MozReview-Commit-ID: JovQWjN3YJx
--HG--
extra : rebase_source : bd25ba4276ae21ff4feb80e56b311202019268a0
We need another flag that represents allow-negative-number for SMIL, so
this enum will also comprise the another parsing mode that allows negative number.
MozReview-Commit-ID: IDFNppjGeB
--HG--
extra : rebase_source : 456f661b33346ff4a756a66c6accf4ab1a5f2f80
The telemetry is recorded once per effect:target pair, and is intended for
comparison with the telemetry added in bug 1349808.
MozReview-Commit-ID: 8JYbAifjmki
--HG--
extra : rebase_source : a5adf4ea9c0836d9ad0ecde5e5869d00eccc2205
The telemetry is recorded once per effect:target pair, and is intended for
comparison with the telemetry added in bug 1349808.
MozReview-Commit-ID: 8JYbAifjmki
--HG--
extra : rebase_source : fa0b615684ca1355f9bbc24b3355e90001db47b5
We can reuse ParseProperty in nsDOMWindowUtils::ComputeAnimationDistance(),
so factor out this function.
MozReview-Commit-ID: FdXGPxOZf84
--HG--
extra : rebase_source : 525bb436fdc1ce4d1241a08b198f9cd572506a86
By passing the startTime as a TimeDuration we are able to represent times in the
distant past (and with the same range as we can represent on the main thread so
that if we do encounter range errors in future, they should not differ between
the main thread and the compositor).
This patch includes a crashtest. I have verified that, without the code changes
included in this patch, this crashtest fails on debug builds on OSX.
MozReview-Commit-ID: EDuKLzfEC0K
--HG--
extra : rebase_source : 1883080fdfac8c33f70698145f21e67cbdfdd4f2
In bug 1223658 we separated out the delay from the start time but we failed to
remove it from this calculation. As a result, when a pending animation begins it
will have the delay applied twice (once here, and once when it is sampled on the
compositor). This will happen until the layer is next updated.
This bug was not exposed by any existing tests since we don't use this code path
when the refresh driver is under test control. Furthermore, the one test that
was supposed to cover this was refactored in such a way that it stopped testing
this code path. That test is restored earlier in this patch series and enabled
in this patch.
MozReview-Commit-ID: B2KR7YaPsMK
--HG--
extra : rebase_source : 6c888252813fbfc01baf5d4bb1728d989ee1586c
Once upon a time[1] a test was added to test_deferred_start.html to test the
code path where we establish the start time to pass to the compositor when
resolving a pending animation.
Later[2], however, we encountered intermittent failures on B2G so we made it
stop waiting on animation.ready and use waitForPaints instead. There were two
problems with this, however.
Firstly, waiting for paints often means that extra paints are processed such
that we end up updating the start time on the layer using a different code path
and masking any potential bugs in the code path under test.
Secondly, when we made this change we replaced:
return animation.ready.then(function() { /* test code */ })
with:
return waitForPaints(function() { /* test code */ })
And sadly that means that 'test code' never runs. Of course, what we meant to
write was:
return waitForPaints().then(function() { /* test code */ })
As a result, when we later broke the code path under test no one noticed.
This patch restores the test so that it tests what it intends to (and currently
fails, at least most of the time).
[1] https://hg.mozilla.org/mozilla-central/rev/79cac8c71159
[2] https://hg.mozilla.org/mozilla-central/rev/986b18fdfdba
[3] https://hg.mozilla.org/mozilla-central/rev/b66b75c2d042101b954e6423438cc07955c2b9bd
MozReview-Commit-ID: 1iMWLQP6zae
--HG--
extra : rebase_source : 2766f25b150af3e98afc6214f59a329798961943
We can early return to call MayHaveAnimations() (and it should be fast) since
we set the flag in EffectSet::GetOrCreateEffectSet(),
MozReview-Commit-ID: 2UfWVVi6nY5
--HG--
extra : rebase_source : 97e98bf1fb9e725a107ed3200b95921375bfb637
We will use this type later in this patch series in nsSMILCSSProperty so this
patch moves it to a separate file so it can be re-used.
MozReview-Commit-ID: 4Z7YbsQ9xz4
--HG--
extra : rebase_source : 0f6f7248d1a4dfc77360829f3a0e6ed263f156db
In the next patch in this series we would like to use this functionality in
nsSMILController as well so this patch moves it to somewhere we can share it.
MozReview-Commit-ID: 1IzWoCCw4aD
--HG--
extra : rebase_source : 9f2b230f774135c0c5bf60ebdff358ce0a6bc087
I have verified that this crashtest fails without the corresponding Servo-side
code changes.
MozReview-Commit-ID: 9obKluN3fgv
--HG--
extra : rebase_source : 71d82eb24ccb9fea1674d08be9b317997df7fe3f
This also happens to fix other bugs, like making display: contents pseudos
animatable, which weren't before.
MozReview-Commit-ID: LhwTPNbFvSZ
--HG--
extra : rebase_source : 785105b08d6bfa15ad257e61b769a263c6810ad0
Animation-only restyle should include both Animation and Transition
cascade levels.
MozReview-Commit-ID: Jo1sb5fGUC0
--HG--
extra : rebase_source : ddd7d796b93f9e7ced912ec4fa2eb79e7ba58784
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
This patch does the following in addition to a simple move:
* change the type of the pointers from RefPtr to nsCOMPtr
* move it from mozilla::css namespace to mozilla
MozReview-Commit-ID: 72MYq6kWm4s
--HG--
extra : rebase_source : 400fe0d7cc422f22592c302cfd4e457830b77e3e
mBaseStyleValuesForServo is a nsRefPtrHashtable<nsUint32HashKey, RawServoAnimationValue>
In this patch, we use void* instead of exposing nsRefPtrHashtable in FFI
because we just use the hash table as an argument of a C++ function, it means
we don't touch the hash table in Rust at all.
MozReview-Commit-ID: 1wM6NeF2S0t
--HG--
extra : rebase_source : 17908ff84d061e189f21641bf660dc9720b964bc
After this, we will implement additive or accumulative calculation
in this Rust function.
MozReview-Commit-ID: 4xAvLz1oTIZ
--HG--
extra : rebase_source : c0672cb1c894eadaaebec94dce2f0d1c1a77d244
This will be used for animation value composition in Rust.
MozReview-Commit-ID: Lg4dZrQW1WC
--HG--
extra : rebase_source : e03b19aa7907c122f773b2b06df96aee4fe32ae2
In the next patch we want to add a method called
GetUnanimatedStyleContextForElementNoFlush but that's much too long. Instead it
seems better to just drop 'ForElement' from all these methods since it should be
fairly obvious we are getting the style context for an element given that the
first argument is an element.
MozReview-Commit-ID: JQKaEuCKV2F
--HG--
extra : rebase_source : 3ba51f3b00d1ec7bc91102629d9c0abb88992fef
We will obsolete StyleAnimationValue in the future, and can treat
AnimationValue as a wrapper of RawServoAnimationValue to hide the FFIs
at that moment. For now, we still need both types, so it's better to make sure
they are mutually exclusive in AnimationValue. Therefore, let's add some
assertions.
Besides, I think those FFIs might do many things and it seems those methods
are not critical, so let's move them into the cpp file, so we can remove
some dependencies to avoid re-compiling so many files if someone needs
revise ServoBindings.h.
MozReview-Commit-ID: FJ1uTvEQ7NT
--HG--
extra : rebase_source : 8ef99c659f2721c8425364051db19b66536bccc6
Otherwise we hit below assertion in nsCSSValue::DoReset().
MOZ_ASSERT(NS_IsInCompositorThread() || !ServoStyleSet::IsInServoTraversal());
PropertyValuePair.mValue was introduced for computing paced timing in the case
where there is some invalid values in keyframes. Paced timing has been removed
removed from the spec and stylo will not support paced timing. So we don't need
to set the value for stylo.
MozReview-Commit-ID: 3I8QSvF2jL8
--HG--
extra : rebase_source : 42155d7fac85aa7fb068e8a514867e8f1c27ed30
I have verified that this test fails without the fix from the previous patch.
MozReview-Commit-ID: Hx8D72nTb32
--HG--
extra : rebase_source : 48b53f86fbcf92db6a5d340d2348fe23003aab0f
This patch adds a test that when reverse throws an exception we don't report
anything to animation mutation observers. I have verified that this added test
fails without the early return added to Animation::Reverse() earlier in this
patch series.
MozReview-Commit-ID: 64yX4G7iaIt
--HG--
extra : rebase_source : 3f29335303c969a8e2ad5ac2c16aba276036b434
This function is only used in test_animation_observers_sync.html. Putting it in
another file makes test_animation_observers_sync.html harder to follow so until
we actually share it with other files we should be it in the one file.
MozReview-Commit-ID: DJXWH4wFWxZ
--HG--
extra : rebase_source : cf5c93f0bee5b03862ad9162c55e1df97b875a6d
As part of this patch series I'd like to add an animation observer test.
However, the current arrangement of test files is quite confusing. We have:
test_animation_observers.html - Tests that run async only
test_observers_for_sync_api.html - Tests that can be run synchronously
It's not at all obvious that these are related or that one is related to the
other. In this patch we rename the files so that their relationship is more
obvious. In a subsequent patch we'll add comments to further clarify the
distinction.
MozReview-Commit-ID: CSYL8wruWdK
--HG--
rename : dom/animation/test/chrome/test_animation_observers.html => dom/animation/test/chrome/test_animation_observers_async.html
rename : dom/animation/test/chrome/test_observers_for_sync_api.html => dom/animation/test/chrome/test_animation_observers_sync.html
extra : rebase_source : a8bfde42b9996f172f090e95970e355106757d8a
We will use this function for stylo computed values as well.
MozReview-Commit-ID: IxDg4EZARi3
--HG--
extra : rebase_source : dc6445ab0c836393913d64313c8151f31cd7b523
Also it's renamed to EnsureBaseStyle. We didn't use the return value at all.
MozReview-Commit-ID: Cu4rnAP883M
--HG--
extra : rebase_source : 1ced02e7ebd6a3c6c66c45f4a2a0b24e0bce6031
Per bug 1322570 Comment 7, we could drop the GetParentAllowServo() when we
invoke UpdateProperties() from a SquentialTask, so allow it for now.
MozReview-Commit-ID: 52NauGaz4Zv
--HG--
extra : rebase_source : 617c3310a042ca49023ebad1801a2c283e4e212c
nsStyleContext::CalcDifference had an optimization where, when we knew
that the old and new style context have the same rule node, we knew that
the only change hints that would need to be handled are those in the
"not handled for descendants" category, generated due to explicit
'inherit' values on reset properties. This was because any changes due
to differences in inherited properties should only have generated
"handled for descendants" change hints (and thus would already have been
handled on an ancestor).
Before bug 931668, this let us avoid calling CalcDifference on structs
that only would have generated hints that we knew we already would have
handled. However, after bug 931668, we compare all structs anyway so
that we can set the aEqualStructs outparam, so we don't gain anything
from this optimization. We can still return these change hints we know
will not need to be handled, and rely on ElementRestyler::CaptureChange
to filter them out.
MozReview-Commit-ID: Ld1s2Js0i6r
We use Servo css-parser to parse keyframe property-value pairs, so we
should also use it to parse easing for Web Animations.
MozReview-Commit-ID: FsfHQaNT2xO
--HG--
extra : rebase_source : 8eb6489f257839f2c0de943b63cc1c04b44ff7a5
In order to avoid creating a temporary nsTimingFunction in some cases and
calling Init(), add some useful constructors to reduce the redundant code.
MozReview-Commit-ID: I8zmWeKl9aw
--HG--
extra : rebase_source : 50a9adc90c26c16fd1dcd7b70c519794b8d406fd
We use Servo css-parser to parse keyframe property-value pairs, so we
should also use it to parse easing for Web Animations.
MozReview-Commit-ID: FsfHQaNT2xO
--HG--
extra : rebase_source : f0426f90e4698363b0ce0271943b31418458301d
In order to avoid creating a temporary nsTimingFunction in some cases and
calling Init(), add some useful constructors to reduce the redundant code.
MozReview-Commit-ID: I8zmWeKl9aw
--HG--
extra : rebase_source : ef3b73e9e8798b2953f7db6ea5bb43ee12403649
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
Later in this patch series we will replace ServoAnimationRule with a hashmap.
At that point, we would like to pass the hashmap to ComposeStyle. In order
to achieve that, this patch templatizes the 'animation rule' parameter of
ComposeStyle in both Animation and KeyframeEffectReadOnly so that it can
represent a hashmap instead.
MozReview-Commit-ID: H5bMxjN3W8n
--HG--
extra : rebase_source : 58cd9ee1cda51970d35c52b39d2cdab12055e24a
The only one caller of GetServoAnimationRule is Gecko_GetAnimationRule.
There is no risk that pres context is destroyed in Gecko_GetAnimationRule.
MozReview-Commit-ID: 52pxbCiCNoJ
--HG--
extra : rebase_source : 8000e267d1d5706c709f807e11396dda3579c4dc
cssPseudoElementBeforeProperty and cssPseudoElementAfterProperty are for
CSSPseudoElement.
MozReview-Commit-ID: 3WETv4QeC5
--HG--
extra : rebase_source : b7e902786ca9ebe7c92a573604e15d868c6067a7
Also removed the function GetPresContext() in KeyframeEffectReadOnly.cpp
and KeyframeEffectReadOnly.h
MozReview-Commit-ID: AJCgxQ05yVQ
--HG--
extra : rebase_source : d85db8bf29079964e4210e5b3a381e8483d92441
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
This makes it more obvious that the object is not being modified but a
new object is being returned.
MozReview-Commit-ID: A6dH8f12h5A
--HG--
extra : rebase_source : b2f8de2e685129552c598a4be499d703e1a73b6b
Edited all function calls in KeyFrameEffectReadOnly.cpp and one function call in EffectCompositor.cpp
MozReview-Commit-ID: BzSHLZna4xX
--HG--
extra : rebase_source : ee5a8196ce73e67308974b7fb5be19f61982320b
While we're here, don't re-recompute the default computed values, just grab them
from the device.
MozReview-Commit-ID: GqqnPLIwN2F
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
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
Use eCSSUnit_Function to store the frames timing function. Also, add one more
css keyword: frames.
The following changes are included in this:
1. Parser changes.
2. Serialization.
3. Computation in nsRuleNode.
4. Invalid and other values in property_database.js
MozReview-Commit-ID: 887QcXHQ2pU
--HG--
extra : rebase_source : ca0135380ea432cb69c4f36cf502d404e04999e5