Closed Bug 1643201 Opened 4 years ago Closed 4 years ago

Sync servo stuff.

Categories

(Core :: CSS Parsing and Computation, task)

task

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

(Blocks 1 open bug)

Details

Attachments

(20 files)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
No description provided.

This refactor is preparation for implementing a specification
compliant transitions and animations processing model.

These data structures hold all the animation information about a single
node. Since adding, updating, and modifying animations for a single node
are all interdependent, it makes sense to start encapsulating animation
data and functionality into a single data structure. This also opens up
the possibility for easier concurrency in the future by more easily
allowing per-node mutexes.

When doing a restyle, we should apply animations and transitions to the
new style so that it is reflected in getComputedStyle() and the new
style information properly cascades. This is the first part of properly
ticking animations and transitions.

This causes a couple new animations tests failures (along with many new
passes), but we currently don't have support for properly handling
animations after they have completed, so this isn't totally unexpected.

Depends on D78184

update_style_for_animation previously handled both canceling defunct
animations and also updating style to reflect current animation state.
This change splits those two concerns because we want to start handling
replaced or canceled animations and finished animations in two different
places.

This is a refactor, so ideally it shouldn't change any behavior.

Depends on D78185

This is triggered when an animation finishes. This is a high priority
because it allows us to start rooting nodes with animations in the
script thread.

This doesn't yet cause a lot of tests to pass because they rely on the
existence of Document.getAnimations() and the presence of
animationstart and animationiteration` events.

Depends on D78186

This change corrects synchronization issues with animations, by
reworking the animation processing model to do a quick restyle and
incremental layout when ticking animations.

While this change adds overhead to animation ticks, the idea is that
this will be the fallback when synchronous behavior is required to
fulfill specification requirements. In the optimistic case, many
animations could be updated and applied off-the-main-thread and then
resynchronized when style information is queried by script.

Fixes #13865.

Depends on D78187

This is a small step toward fixing #19242. The main idea is that the
clock for animations should advance as the event loop ticks. We
accomplish this by moving the clock from layout and naming it the
"animation timeline" which is the spec language. This should fix
flakiness with animations and transitions tests where a reflow could
move animations forward while script was running.

This change also starts to break out transition and animation events
into their own data structure, because it's quite likely that the next
step in fixing #19242 is to no longer send these events through a
channel.

Depends on D78188

This change splits the list of animations and transitions, which are
almost always handled differently. It also renames
ElementAnimationState to ElementAnimationSet and establishes an
AnimationState for every transition and animation. This allows us to
stop continually reallocating lists every time a transition or animation
needs to be canceled.

Fixes #14419.

Depends on D78189

This implementation is more-or-less on par with the one from layout_2013
and in some cases better. There are still some cases where we don't
return the correct "resolved value," but this is enough to test
animations and transitions.

Depends on D78190

This is preparation for sharing this code with layout_2020 and
implementing selective off-the-main-thread animations.

We still look for nodes not in the flow tree in the layout thread.

Depends on D78191

This removes an extra layer of abstraction and allows Servo to share
more code with Gecko. In addition, we will need to handle raw
AnimationValue structs soon in order to fully implement "faster
reversing of interrupted transitions."

Depends on D78192

Fixes #26460.

Depends on D78194

Depends on D78198

The size of LLVM IR for the style crate is reduced by ~1.5% (27k lines out of 1.8M)

CC https://github.com/servo/servo/issues/26713

Depends on D78202

Depends on D78203

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bdb02303566d
servo: Add ElementAnimationState and PossibleElementAnimationState.
https://hg.mozilla.org/integration/autoland/rev/6afd89eee82b
servo: Restyle should reflect animations and transitions.
https://hg.mozilla.org/integration/autoland/rev/7937d276db3e
servo: Split animation cancellation from update_style_for_animation.
https://hg.mozilla.org/integration/autoland/rev/1779bf62260b
servo: Add support for animationend event.
https://hg.mozilla.org/integration/autoland/rev/c4b33abc1b98
servo: Use a restyle for animation ticks.
https://hg.mozilla.org/integration/autoland/rev/ac13071264c4
servo: Start having animations conform to the HTML spec.
https://hg.mozilla.org/integration/autoland/rev/e8e92526100a
servo: Split animations and transitions into separate lists.
https://hg.mozilla.org/integration/autoland/rev/96fbb7b812da
servo: layout_2020: Add initial support for getComputedStyle.
https://hg.mozilla.org/integration/autoland/rev/e907368ef285
servo: Move most animation processing to script.
https://hg.mozilla.org/integration/autoland/rev/99aa4226e81a
servo: Remove AnimatedProperty.
https://hg.mozilla.org/integration/autoland/rev/46918ab447af
servo: `display: contents` computes to `block` on the root element.
https://hg.mozilla.org/integration/autoland/rev/47f49e90072d
servo: Implement `animation-fill-mode`.
https://hg.mozilla.org/integration/autoland/rev/5d9d36ffbe79
servo: layout_2020: Add support for transitions and animations.
https://hg.mozilla.org/integration/autoland/rev/bba2644b07f9
servo: Return the root from the traversal.
https://hg.mozilla.org/integration/autoland/rev/d9fdb200ad7d
Miscellaneous build fixes.
https://hg.mozilla.org/integration/autoland/rev/281a323cde5f
Cherry-pick some servo changes to derive_common.
https://hg.mozilla.org/integration/autoland/rev/12ed642c5d13
Cherry-pick some Servo Cargo.toml cleanups.
https://hg.mozilla.org/integration/autoland/rev/bde27b38c9c5
Cherry-pick servo changes to use the matches macro from the standard library.
https://hg.mozilla.org/integration/autoland/rev/8e720ce58686
Move most of `SequenceWriter::write_item` to non-generic functions.
https://hg.mozilla.org/integration/autoland/rev/2aff0731b7a8
Rustfmt recent changes.

Yeah, that one is expected because apparently we don't yet require a new enough rustc.

Flags: needinfo?(emilio)
Blocks: 1573113

Comment on attachment 9154043 [details]
Bug 1643201 - Cherry-pick some servo changes to derive_common.

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Build fix for new rust compiler versions.
  • User impact if declined: none
  • Fix Landed on Version: 79
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Build-only code change.
  • String or UUID changes made by this patch: none
Attachment #9154043 - Flags: approval-mozilla-esr78?

Comment on attachment 9154043 [details]
Bug 1643201 - Cherry-pick some servo changes to derive_common.

approved for 78.4esr

Attachment #9154043 - Flags: approval-mozilla-esr78? → approval-mozilla-esr78+

Comment on attachment 9154043 [details]
Bug 1643201 - Cherry-pick some servo changes to derive_common.

I'm going to clear both the status and uplift flag for this, only one patch made it to esr78.

Attachment #9154043 - Flags: approval-mozilla-esr78+

can confirm that 78.4.0rc2 doesnt build with rust 1.47.0.

Having also problem with Thunderbird 78.4 (same with 78.3).

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: