diff options
author | Ilyong Cho <ilyoan@gmail.com> | 2013-10-30 16:06:35 +0900 |
---|---|---|
committer | Ilyong Cho <ilyoan@gmail.com> | 2013-10-31 11:33:40 +0900 |
commit | 901dfc45e5ed2e0506a18488be69e083fd59501f (patch) | |
tree | 9b677ba2ecc7956d86d0a8f14bde3936e7d487cb /src/components/main/layout/layout_task.rs | |
parent | 1a7e9e5e2c02d9e023c901f14a8b54e9a3c6a8a2 (diff) | |
download | servo-901dfc45e5ed2e0506a18488be69e083fd59501f.tar.gz servo-901dfc45e5ed2e0506a18488be69e083fd59501f.zip |
parallel selector matching
Diffstat (limited to 'src/components/main/layout/layout_task.rs')
-rw-r--r-- | src/components/main/layout/layout_task.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/components/main/layout/layout_task.rs b/src/components/main/layout/layout_task.rs index cb029942710..aa721a54860 100644 --- a/src/components/main/layout/layout_task.rs +++ b/src/components/main/layout/layout_task.rs @@ -20,7 +20,7 @@ use std::cast::transmute; use std::cell::Cell; use std::comm::{Port}; use std::task; -use extra::arc::Arc; +use extra::arc::{Arc, RWArc}; use geom::point::Point2D; use geom::rect::Rect; use geom::size::Size2D; @@ -65,7 +65,7 @@ struct LayoutTask { display_list: Option<Arc<DisplayList<AbstractNode<()>>>>, - stylist: Stylist, + stylist: RWArc<Stylist>, profiler_chan: ProfilerChan, } @@ -240,7 +240,7 @@ impl LayoutTask { display_list: None, - stylist: new_stylist(), + stylist: RWArc::new(new_stylist()), profiler_chan: profiler_chan, } } @@ -293,7 +293,10 @@ impl LayoutTask { } fn handle_add_stylesheet(&mut self, sheet: Stylesheet) { - self.stylist.add_stylesheet(sheet, AuthorOrigin); + let sheet = Cell::new(sheet); + do self.stylist.write |stylist| { + stylist.add_stylesheet(sheet.take(), AuthorOrigin) + } } /// The high-level routine that performs layout tasks. @@ -335,7 +338,7 @@ impl LayoutTask { ReflowDocumentDamage => {} MatchSelectorsDocumentDamage => { do profile(time::LayoutSelectorMatchCategory, self.profiler_chan.clone()) { - node.match_subtree(&self.stylist); + node.match_subtree(self.stylist.clone()); node.cascade_subtree(None); } } |