aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/layout_task.rs
diff options
context:
space:
mode:
authorBobby Holley <bobbyholley@gmail.com>2015-12-17 16:21:29 -0800
committerBobby Holley <bobbyholley@gmail.com>2015-12-29 12:07:07 -0800
commita05d7f1dfd8500d299007af99861cc86fada9386 (patch)
treeea956e5046b37168344bdff3ffc4274007d54ab6 /components/layout/layout_task.rs
parent47059d2d26f14f71e5b7212fa8bc01608eca11b5 (diff)
downloadservo-a05d7f1dfd8500d299007af99861cc86fada9386.tar.gz
servo-a05d7f1dfd8500d299007af99861cc86fada9386.zip
Hoist style-related context bits into style/.
We do a few things-here: * Hoist non-layout-dependent fields in SharedLayoutData and LocalLayoutData into style/. * Hoist parts of css/matching.rs into style/. * Hoist parts of layout/animation.rs into style/animation.rs. * Remove the duplicated-but-slightly-different definition of OpaqueNode.
Diffstat (limited to 'components/layout/layout_task.rs')
-rw-r--r--components/layout/layout_task.rs23
1 files changed, 13 insertions, 10 deletions
diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs
index 7cec9ed2948..33c0a343fcd 100644
--- a/components/layout/layout_task.rs
+++ b/components/layout/layout_task.rs
@@ -12,7 +12,7 @@ use app_units::Au;
use azure::azure::AzColor;
use canvas_traits::CanvasMsg;
use construct::ConstructionResult;
-use context::{SharedLayoutContext, StylistWrapper, heap_size_of_local_context};
+use context::{SharedLayoutContext, heap_size_of_local_context};
use display_list_builder::ToGfxColor;
use euclid::Matrix4;
use euclid::point::Point2D;
@@ -64,6 +64,7 @@ use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::mpsc::{channel, Sender, Receiver};
use std::sync::{Arc, Mutex, MutexGuard, RwLock};
use style::computed_values::{filter, mix_blend_mode};
+use style::context::{SharedStyleContext, StylistWrapper};
use style::dom::{TDocument, TElement, TNode};
use style::media_queries::{Device, MediaType};
use style::selector_matching::{Stylist, USER_OR_USER_AGENT_STYLESHEETS};
@@ -470,21 +471,23 @@ impl LayoutTask {
goal: ReflowGoal)
-> SharedLayoutContext {
SharedLayoutContext {
+ style_context: SharedStyleContext {
+ viewport_size: self.viewport_size.clone(),
+ screen_size_changed: screen_size_changed,
+ stylist: StylistWrapper(&*rw_data.stylist),
+ generation: self.generation,
+ goal: goal,
+ new_animations_sender: Mutex::new(self.new_animations_sender.clone()),
+ running_animations: self.running_animations.clone(),
+ expired_animations: self.expired_animations.clone(),
+ error_reporter: self.error_reporter.clone(),
+ },
image_cache_task: self.image_cache_task.clone(),
image_cache_sender: Mutex::new(self.image_cache_sender.clone()),
- viewport_size: self.viewport_size.clone(),
- screen_size_changed: screen_size_changed,
font_cache_task: Mutex::new(self.font_cache_task.clone()),
canvas_layers_sender: Mutex::new(self.canvas_layers_sender.clone()),
- stylist: StylistWrapper(&*rw_data.stylist),
url: (*url).clone(),
visible_rects: self.visible_rects.clone(),
- generation: self.generation,
- new_animations_sender: Mutex::new(self.new_animations_sender.clone()),
- goal: goal,
- running_animations: self.running_animations.clone(),
- expired_animations: self.expired_animations.clone(),
- error_reporter: self.error_reporter.clone(),
}
}