From eaf27ccfa0342459804dd7ee9a3619948d0b6786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 13 Mar 2017 22:50:43 +0100 Subject: style: Kill SharedStyleContext::default_computed_values. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that cascade() gets a Device, we can use the default computed values from there to avoid propagating that state all over the place. Signed-off-by: Emilio Cobos Álvarez --- components/layout_thread/lib.rs | 6 ------ 1 file changed, 6 deletions(-) (limited to 'components/layout_thread/lib.rs') diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index 529100c06d8..d3e28e5f48d 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -114,7 +114,6 @@ use style::error_reporting::{ParseErrorReporter, StdoutErrorReporter}; use style::logical_geometry::LogicalPoint; use style::media_queries::{Device, MediaType}; use style::parser::ParserContextExtraData; -use style::properties::ComputedValues; use style::servo::restyle_damage::{REFLOW, REFLOW_OUT_OF_FLOW, REPAINT, REPOSITION, STORE_OVERFLOW}; use style::stylesheets::{Origin, Stylesheet, UserAgentStylesheets}; use style::stylist::Stylist; @@ -510,11 +509,6 @@ impl LayoutThread { local_context_creation_data: Mutex::new(thread_local_style_context_creation_data), timer: self.timer.clone(), quirks_mode: self.quirks_mode.unwrap(), - // FIXME(bz): This isn't really right, but it's no more wrong - // than what we used to do. See - // https://github.com/servo/servo/issues/14773 for fixing it - // properly. - default_computed_values: Arc::new(ComputedValues::initial_values().clone()), }, image_cache_thread: Mutex::new(self.image_cache_thread.clone()), font_cache_thread: Mutex::new(self.font_cache_thread.clone()), -- cgit v1.2.3 From b4de69e3ebf5b2a6e82b68b66df090e9220b9e61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 14 Mar 2017 00:12:38 +0100 Subject: style: Avoid cloning all over the error reporter. --- components/layout_thread/lib.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'components/layout_thread/lib.rs') diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index d3e28e5f48d..58f81a71a59 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -110,7 +110,7 @@ use style::animation::Animation; use style::context::{QuirksMode, ReflowGoal, SharedStyleContext, ThreadLocalStyleContextCreationInfo}; use style::data::StoredRestyleHint; use style::dom::{ShowSubtree, ShowSubtreeDataAndPrimaryValues, TElement, TNode}; -use style::error_reporting::{ParseErrorReporter, StdoutErrorReporter}; +use style::error_reporting::StdoutErrorReporter; use style::logical_geometry::LogicalPoint; use style::media_queries::{Device, MediaType}; use style::parser::ParserContextExtraData; @@ -505,7 +505,7 @@ impl LayoutThread { stylist: rw_data.stylist.clone(), running_animations: self.running_animations.clone(), expired_animations: self.expired_animations.clone(), - error_reporter: self.error_reporter.clone(), + error_reporter: Box::new(self.error_reporter.clone()), local_context_creation_data: Mutex::new(thread_local_style_context_creation_data), timer: self.timer.clone(), quirks_mode: self.quirks_mode.unwrap(), @@ -1563,7 +1563,7 @@ fn get_ua_stylesheets() -> Result { Origin::UserAgent, Default::default(), None, - Box::new(StdoutErrorReporter), + &StdoutErrorReporter, ParserContextExtraData::default())) } @@ -1576,8 +1576,7 @@ fn get_ua_stylesheets() -> Result { for &(ref contents, ref url) in &opts::get().user_stylesheets { user_or_user_agent_stylesheets.push(Stylesheet::from_bytes( &contents, url.clone(), None, None, Origin::User, Default::default(), - None, Box::new(StdoutErrorReporter), - ParserContextExtraData::default())); + None, &StdoutErrorReporter, ParserContextExtraData::default())); } let quirks_mode_stylesheet = try!(parse_ua_stylesheet("quirks-mode.css")); -- cgit v1.2.3