aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/animation.rs
Commit message (Collapse)AuthorAgeFilesLines
* Move most animation processing to scriptMartin Robinson2020-05-121-218/+0
| | | | | | | 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.
* Split animations and transitions into separate listsMartin Robinson2020-05-061-84/+83
| | | | | | | | | | | 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.
* Start having animations conform to the HTML specMartin Robinson2020-05-051-8/+10
| | | | | | | | | | | | | | 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.
* Use a restyle for animation ticksMartin Robinson2020-05-051-109/+64
| | | | | | | | | | | | | | 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.
* Add support for animationend eventMartin Robinson2020-05-011-30/+54
| | | | | | | | | | 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.
* Split animation cancellation from update_style_for_animationMartin Robinson2020-04-301-14/+12
| | | | | | | | | | `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.
* Restyle should reflect animations and transitionsMartin Robinson2020-04-291-1/+2
| | | | | | | | | | | 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.
* Add support for transitionrun eventsMartin Robinson2020-04-241-55/+78
| | | | | | These events are triggered as soon as a transition is added to the list of running transitions. This will allow better test coverage while reworking the transitions and animations processing model.
* Add ElementAnimationState and PossibleElementAnimationStateMartin Robinson2020-04-241-155/+121
| | | | | | | | | | | | 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.
* Add support for canceling CSS transitionsMartin Robinson2020-04-221-6/+44
| | | | | | | | | | | This change adds support for canceling CSS transitions when a property is no longer transitionable or when an element becomes styled with display:none. Support for canceling and replacing CSS transitions when the end value changes is still pending. This change also takes advantage of updating the constellation message to fix a bug where transition events could be sent for closed pipelines. Fixes #15079.
* Eliminate `AnimationFrame`Martin Robinson2020-04-181-5/+5
| | | | | This intermediate data structure doesn't really buy us anything and is a bit confusing.
* Avoid infinitely looping CSS transitions.Josh Matthews2020-04-011-0/+1
|
* Rustfmt has changed its default style :/Simon Sapin2018-12-281-10/+11
|
* Cancel animations that affect nodes that do not participate in layout.Josh Matthews2018-12-101-5/+21
|
* Update MPL license to https (part 4)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* Update crossbeam-channel to 0.3Bastien Orivel2018-11-181-2/+2
|
* `cargo fix --edition-idioms`Simon Sapin2018-11-081-1/+1
|
* Reorder importsPyfisch2018-11-061-2/+2
|
* Format remaining filesPyfisch2018-11-061-7/+13
|
* Sort `use` statementsSimon Sapin2018-11-061-1/+1
|
* `cargo fix --edition`Simon Sapin2018-11-061-4/+4
|
* style: More useful logging for transition-related stuff.Emilio Cobos Álvarez2018-10-151-0/+2
| | | | | Transitions are still broken, but I found these messages more helpful than the previous ones when diagnosing problems.
* style: Remove unused expired boolean in Animation::Transition.Emilio Cobos Álvarez2018-10-151-8/+7
| | | | | | | | | | | | The last caller who used was #14418, which did fix a problem but introduced multiple. In particular, now transitions don't get expired ever, until they finish running of course. That is not ok, given you can have something that the user can trigger to change the style (hi, :hover, for example), and right now that triggers new transitions, getting this into a really funny state. I should give fixing this a shot, but it's non-trivial at all.
* Replace mpsc with crossbeam/servo channel, update ipc-channelSimon Sapin2018-09-121-2/+2
| | | | Co-authored-by: Gregory Terzian <gterzian@users.noreply.github.com>
* Rustfmt layout cratePyfisch2018-09-011-28/+28
|
* Fix Servo build.Emilio Cobos Álvarez2018-08-081-4/+4
|
* style: Fix servo build.Emilio Cobos Álvarez2018-05-051-3/+3
|
* Move DL items from gfx to layoutPyfisch2018-04-221-1/+1
| | | | | | | | | Implement corner clipping. Remove PixelFormat from WebrenderImageInfo. Use WebRender text shadow. Remove MallocSizeOf and Deserialize for DL items. Closes #19649, #19680, #19802
* style: Make the TElement type arrive to the `cascade` function.Emilio Cobos Álvarez2018-01-231-20/+29
| | | | | | | | | | | | | | | | | Not super-proud of this one, but it's the easiest way I could think of. The changeset looks bigger than what it is, because while at it I've rewrapped a fair amount of functions around to use proper block indentation. Alternatives are parameterizing Stylist by <E>, which is not fun, or moving the concrete element from layout_thread to layout, but that implies layout depending on script, which isn't fun either. Other alternative is implementing an empty enum and making anon boxes work on it. It has the advantage of removing the annoying type parameter, but the disadvantage of instantiating `cascade` twice, which isn't great, and having to maintain all the boilerplate of a `TElement` implementation that just does nothing.
* Turn flow::base and friends into methodsMatt Brubeck2017-12-141-2/+2
|
* stylo: Remove a lot of the restyle damage related complexity.Emilio Cobos Álvarez2017-08-201-3/+4
| | | | | | | | | | The only reason why we had the `existing_style_for_style_damage` bit is to apply some optimizations that we don't have anymore. I still want to reintroduce a few of them, at least for the non-eager pseudo-element case... But I think I won't need this at all. This allows us to remove a fair amount of Gecko code too.
* Upgrade to rustc 1.21.0-nightly (13d94d5fa 2017-08-10)Simon Sapin2017-08-151-1/+1
|
* Revert "Backed out changeset b10e6ba9cbdb because gecko part had to be ↵Emilio Cobos Álvarez2017-07-201-1/+3
| | | | | | | | backed out." This reverts commit b96d96d448c8ff93f212f225013461999540a5d0. The fix on the Gecko side is trivial, and I can land it after this lands.
* Backed out changeset b10e6ba9cbdb because gecko part had to be backed out. ↵Gecko Backout2017-07-201-3/+1
| | | | | | r=backout on a CLOSED TREE Backs out https://github.com/servo/servo/pull/17796
* style: Pass old ComputedValues and old cached struct bits to ↵Cameron McCormack2017-07-201-1/+3
| | | | Gecko_CalcStyleDifference.
* style: Avoid some cfg checks in context.rsEmilio Cobos Álvarez2017-05-291-4/+4
|
* style: Use RestyleDamage to determine whether we must continue cascading ↵Cameron McCormack2017-05-201-1/+3
| | | | style changes to children.
* Warn about ignored transitions which can't be rooted.Josh Matthews2017-05-151-4/+8
|
* Accumulate transitioning nodes inside the layout context.Josh Matthews2017-05-151-3/+6
|
* Root nodes for the duration of their CSS transitions.Josh Matthews2017-05-151-3/+10
| | | | | | | | This ensures that we can pass a node address as part of the asynchronous transition end notification, making it safe to fire the corresponding DOM event on the node from the script thread. Without explicitly rooting this node when the transition starts, we risk the node being GCed before the transition is complete.
* stylo: Store font metrics provider in thread local style contextManish Goregaokar2017-04-091-1/+3
|
* Remove cached thread local context from LayoutContextPu Xingyu2017-02-081-2/+2
| | | | | Remove cached thread local context from LayoutContext, use LayoutContext for assign_inline_sizes(), and simplify the parallel flow traversal code.
* style: Document the animated_properties code.Emilio Cobos Álvarez2016-12-311-1/+1
|
* Make Restyle tracking more granular.Bobby Holley2016-12-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The primary idea of this patch is to ditch the rigid enum of Previous/Current styles, and replace it with a series of indicators for the various types of work that needs to be performed (expanding snapshots, rematching, recascading, and damage processing). This loses us a little bit of sanity checking (since the up-to-date-ness of our style is no longer baked into the type system), but gives us a lot more flexibility that we'll need going forward (especially when we separate matching from cascading). We also eliminate get_styling_mode in favor of a method on the traversal. This patch does a few other things as ridealongs: * Temporarily eliminates the handling for transfering ownership of styles to the frame. We'll need this again at some point, but for now it's causing too much complexity for a half-implemented feature. * Ditches TRestyleDamage, which is no longer necessary post-crate-merge, and is a constant source of compilation failures from either needing to be imported or being unnecessarily imported (which varies between gecko and servo). * Expands Snapshots for the traversal root, which was missing before. * Fixes up the skip_root stuff to avoid visiting the skipped root. * Unifies parallel traversal and avoids spawning for a single work item. * Adds an explicit pre_traverse step do any pre-processing and determine whether we need to traverse at all. MozReview-Commit-ID: IKhLAkAigXE
* layout: Minor style cleanup.Patrick Walton2016-11-301-3/+5
|
* Remove SelectorImpl aliasesSimon Sapin2016-11-221-2/+2
|
* Rename selector_impl.rs to selector_parser.rsSimon Sapin2016-11-201-1/+1
| | | | This makes it consistent with an upcoming update of the selectors crate.
* Stop using associated types for the concrete TRestyleDamage implementation.Bobby Holley2016-11-071-1/+1
| | | | MozReview-Commit-ID: LfaZFCVlIb1
* Emit TransitionEnd events in the layout thread and process it in the script ↵Keith Yeung2016-10-111-2/+10
| | | | thread
* Make RestyleDamage::compute take no optional argument, delegate the handling ↵Emilio Cobos Álvarez2016-08-101-1/+1
| | | | to the caller.