We shouldn't call synthesizeWheelAtPoint() in an rAF callback and observe
animation restyle makers there since we might end up observing an animation
restyle maker which is brought by flushing throttled animation styles for
hit-testing caused by the wheel event. Now we have sendWheelAndPaintNoFlush
which does not flush any styles before sending the wheel event, we use it.
MozReview-Commit-ID: 6WP2ExA7fAv
--HG--
extra : rebase_source : a2a5cea00fbe431dea8096b584a9f82c658158aa
Before this patch the child element actually did not move into the view and
observed an unrelated restyle maker. In the next patch we fix the observation
of the unrelated restyle maker.
MozReview-Commit-ID: 1DejqwF6hJg
--HG--
extra : rebase_source : ea6d6a48043f1b2a52ddedcbc41c321624a723d2
It much makes more sense to check the animation in out-of-view is throttled
and unthrottled once it got visible in a single test.
MozReview-Commit-ID: AZY5Xc0cbDF
--HG--
extra : rebase_source : bcdf999ee10283853c7b0bda8f450a53990a0e1c
This was automatically generated by the script modeline.py.
MozReview-Commit-ID: BgulzkGteAL
--HG--
extra : rebase_source : a4b9d16a4c06c4e85d7d85f485221b1e4ebdfede
Before this patch, we had been checking each scrollable ancestor is scrolled
out of its scrollable ancestor. So if the target animating frame is at the
bottom of its scrollable parent and if half of the scrollable parent is
scrolled out of its ancestor, the animating frame was considered as 'in-view'.
MozReview-Commit-ID: BDueuF3cT4I
--HG--
extra : rebase_source : de1dead6e67a44691887c8364be23734c3b1adef
When we receive animations on the compositor, we assert that either they're not
playing, or they have a resolved start and origin time.
However, on the main thread we determine if an animation is playing by checking
if it has a timeline, if it's in the correct state, and if it has a non-zero
playback rate.
The problem with this check is that if an animation has a timeline but it is
inactive, that is, its current time is null, we will not be able to get
a resolved origin time -- yet we will still report that is is playing.
This patch fixes this mismatch by treating animations with an inactive timeline
as "not playing".
The IsPlaying() method is used a number of call sites but it appears that they
all would expect an animation with an inactive timeline to be considered "not
playing". Furthermore, this makes IsPlaying() consistent with the check we do
for an active timeline in other functions such as Animation::Tick(),
TriggerNow(), SilentlySetCurrentTime(), UpdateFinishedState(),
and IsPossibleOrphanedPendingAnimation().
MozReview-Commit-ID: BQOBpHHFMoD
--HG--
extra : rebase_source : e84a50a16a61d48553610cb7ea0863f09ba86c60
This fixes multiple things:
* EffectCompositor was using the light tree instead of the flat tree.
* When we insert an element inside the document, we may not style it right away
(we mark it for lazy frame construction with the NODE_NEEDS_FRAME). Since we
trigger animations and transitions from the traversal, we can't skip flushing
if we call getComputedStyle on any of those.
MozReview-Commit-ID: DpAhmLH3uJ2
There are no reliable steps to make this happen but it appears to have happened
at least twice during fuzzing. As a result, it doesn't matter too much what the
behavior here is as long as we don't crash.
MozReview-Commit-ID: 4gdiBL2wngU
--HG--
extra : rebase_source : 54afce721f8b59c2ad038e0c2222f64e71a9b917
2017-10-25 15:34:50 +09:00
Matt Woodrow ext:(%2C%20Miko%20Mynttinen%20%3Cmikokm%40gmail.com%3E%2C%20Timothy%20Nikkel%20%3Ctnikkel%40gmail.com%3E)
This implements the changes specified in these three spec changesets:
8efd180bd9f43ecdfbe5a4f1ad1a60
MozReview-Commit-ID: KFhgZ5ip6BA
--HG--
extra : rebase_source : aa18f8e3fbcd5d96194ff9a5239a3c415622dc2f
This implements the following change to the Web Animations specification:
19b6c33cee
The background to that change is described in the corresponding spec issue:
https://github.com/w3c/web-animations/issues/201
MozReview-Commit-ID: GGA64LG5vT
--HG--
extra : rebase_source : 92c2a60a250071926c2c998dbfadc5979b89cc0c
We could handle this case by dropping the animation from the pause-pending table
but that's an extra hashtable lookup that so far seems to be unnecessary.
I have verified that the crashtest added in this patch fails without the code
changes included here.
MozReview-Commit-ID: Ed6u7WRLD2t
--HG--
extra : rebase_source : 8b175ef2d06b4394f3c51f740a1d305aeea9ed04
(Path is actually r=froydnj.)
Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.
MozReview-Commit-ID: 91U22X2NydP
--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
When we set the playback rate to zero on a play-pending animation that is
resuming from an aborted pause we can arrive in a state where both the start
time and hold time are resolved. However, we previously added an assertion that
only one of these is ever set at a time.
Part of the assertion is warranted since that method contains the following
code:
if (mStartTime.IsNull()) {
mStartTime = StartTimeFromReadyTime(aReadyTime);
if (mPlaybackRate != 0) {
mHoldTime.SetNull();
}
}
Here StartTimeFromReadyTime requires a non-null hold time. So either mStartTime
or mHoldTime needs to be non-null. The requirement that only one or the other be
non-null, however, is not in the spec and not necessary (as the test cases in
this bug show).
What this assertion does bring to light, however, is that in the case where we
have *both* the start time and the hold time, we need to consider whether to use
the start time as-is, or calculate it from the hold time.
I have filed the following spec issue for this:
https://github.com/w3c/web-animations/issues/200
MozReview-Commit-ID: CTCT7Up1E5n
--HG--
extra : rebase_source : 95233f7cd2bc3c4bcc56615d8387fe54852986c1
As required by the recent spec change:
d696468777
MozReview-Commit-ID: Ev6kUk1uLAY
--HG--
extra : rebase_source : 70f8ca3143a8b3bb4e03016b9989925d5a328049
nsFrame::SchedulePaint() invokes InvalidateRenderingObservers, and
InvalidateRenderingObservers ends up posting change hints during we are
processing sequential tasks for animations, but we don't allow posting any
change hints while we are in the middle of restyling process.
Though the change hints posted by InvalidateRenderingObservers are not harmful
in this case since the change hints will be processed in a second post
traversal without problems. That's said, InvalidateRenderingObservers stuff
should be processed in display list based invalidation anyway (bug 1284053).
MozReview-Commit-ID: GKVRZ98lvEN
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