diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-06-28 17:31:01 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-28 17:31:01 -0500 |
commit | d3a81373e44634c30d31da0457e1c1e86c0911ed (patch) | |
tree | fbefd4e32ec3adff49b2ffec316f8efff6c647d4 /components/layout_thread/lib.rs | |
parent | 7b2080c5b7c933f74c0d92249a66f8602340ebbe (diff) | |
parent | 392f243ca7dd08a34da4ca15dfc5596f69adf4d8 (diff) | |
download | servo-d3a81373e44634c30d31da0457e1c1e86c0911ed.tar.gz servo-d3a81373e44634c30d31da0457e1c1e86c0911ed.zip |
Auto merge of #11766 - emilio:keyframes-parsing, r=SimonSapin,pcwalton
Add `@keyframes` and `animation-*` support.
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
<!-- Either: -->
- [x] There are tests for these changes
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This adds support for parsing `@keyframes` rules, and animation properties. Stylo will need it sometime soonish, plus I want to make animations work in Servo.
The remaining part is doin the math and trigger the animations correctly from servo. I don't expect it to be *that* hard, but probaby I'll need to learn a bit more about the current animation infra (e.g. why the heck is the `new_animations_sender` guarded by a `Mutex`?).
I'd expect to land this, since this is already a bunch of work, this is the part exclusively required by stylo (at least if we don't use Servo's machinery), the media query parsing is tested, and the properties land after a flag, but if you prefer to wait until I finish this up it's fine for me too.
r? @SimonSapin
cc @pcwalton @bholley
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11766)
<!-- Reviewable:end -->
Diffstat (limited to 'components/layout_thread/lib.rs')
-rw-r--r-- | components/layout_thread/lib.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index fad57c499d3..e47670f99c1 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -98,7 +98,6 @@ use std::ops::{Deref, DerefMut}; use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::mpsc::{channel, Sender, Receiver}; use std::sync::{Arc, Mutex, MutexGuard, RwLock}; -use style::animation::Animation; use style::computed_values::{filter, mix_blend_mode}; use style::context::ReflowGoal; use style::dom::{TDocument, TElement, TNode}; @@ -109,7 +108,7 @@ use style::parallel::WorkQueueData; use style::properties::ComputedValues; use style::refcell::RefCell; use style::selector_matching::USER_OR_USER_AGENT_STYLESHEETS; -use style::servo::{SharedStyleContext, Stylesheet, Stylist}; +use style::servo::{Animation, SharedStyleContext, Stylesheet, Stylist}; use style::stylesheets::CSSRuleIteratorExt; use url::Url; use util::geometry::MAX_RECT; @@ -1290,7 +1289,7 @@ impl LayoutThread { self.tick_animations(&mut rw_data); } - pub fn tick_animations(&mut self, rw_data: &mut LayoutThreadData) { + fn tick_animations(&mut self, rw_data: &mut LayoutThreadData) { let reflow_info = Reflow { goal: ReflowGoal::ForDisplay, page_clip_rect: MAX_RECT, @@ -1307,8 +1306,9 @@ impl LayoutThread { self.profiler_metadata(), self.time_profiler_chan.clone(), || { - animation::recalc_style_for_animations(flow_ref::deref_mut(&mut root_flow), - &*animations) + animation::recalc_style_for_animations(&layout_context, + flow_ref::deref_mut(&mut root_flow), + &animations) }); } |