From 5954e0a4baebc3739c9996308a91b3818bb9c8f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 1 Oct 2017 22:03:19 +0200 Subject: [PATCH 1/2] style: Remove conditional imports in traversal.rs --- components/style/traversal.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/style/traversal.rs b/components/style/traversal.rs index c8ec158bf6e..a1eb17b5002 100644 --- a/components/style/traversal.rs +++ b/components/style/traversal.rs @@ -13,11 +13,8 @@ use selector_parser::PseudoElement; use sharing::StyleSharingTarget; use smallvec::SmallVec; use style_resolver::{PseudoElementResolution, StyleResolverForElement}; -#[cfg(feature = "servo")] use style_traits::ToCss; use stylist::RuleInclusion; use traversal_flags::{TraversalFlags, self}; -#[cfg(feature = "servo")] use values::Either; -#[cfg(feature = "servo")] use values::generics::image::Image; /// A per-traversal-level chunk of data. This is sent down by the traversal, and /// currently only holds the dom depth for the bloom filter. @@ -783,6 +780,10 @@ fn notify_paint_worklet(context: &StyleContext, data: &ElementData) where E: TElement, { + use style_traits::ToCss; + use values::Either; + use values::generics::image::Image; + // We speculatively evaluate any paint worklets during styling. // This allows us to run paint worklets in parallel with style and layout. // Note that this is wasted effort if the size of the node has From 0714652d356bbca82319c89dbdd7e90b004fa2bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 1 Oct 2017 22:47:34 +0200 Subject: [PATCH 2/2] style: Remove another cfg'd import. And a redundant assertion while at it. --- components/style/properties/properties.mako.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index b8ec62171df..c27c3c13a80 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -17,7 +17,6 @@ use smallbitvec::SmallBitVec; use std::borrow::Cow; use std::{fmt, mem, ops}; use std::cell::RefCell; -#[cfg(feature = "gecko")] use std::ptr; #[cfg(feature = "servo")] use cssparser::RGBA; use cssparser::{CowRcStr, Parser, TokenSerializationType, serialize_identifier}; @@ -2698,8 +2697,8 @@ impl<'a> StyleBuilder<'a> { debug_assert_eq!(parent_style.is_some(), parent_style_ignoring_first_line.is_some()); #[cfg(feature = "gecko")] debug_assert!(parent_style.is_none() || - ptr::eq(parent_style.unwrap(), - parent_style_ignoring_first_line.unwrap()) || + ::std::ptr::eq(parent_style.unwrap(), + parent_style_ignoring_first_line.unwrap()) || parent_style.unwrap().pseudo() == Some(PseudoElement::FirstLine)); let reset_style = device.default_computed_values(); let inherited_style = parent_style.unwrap_or(reset_style); @@ -3168,11 +3167,6 @@ pub fn cascade( rule_cache_conditions: &mut RuleCacheConditions, ) -> Arc { debug_assert_eq!(parent_style.is_some(), parent_style_ignoring_first_line.is_some()); - #[cfg(feature = "gecko")] - debug_assert!(parent_style.is_none() || - ptr::eq(parent_style.unwrap(), - parent_style_ignoring_first_line.unwrap()) || - parent_style.unwrap().pseudo() == Some(PseudoElement::FirstLine)); let empty = SmallBitVec::new(); let iter_declarations = || { rule_node.self_and_ancestors().flat_map(|node| { @@ -3256,8 +3250,8 @@ where debug_assert_eq!(parent_style.is_some(), parent_style_ignoring_first_line.is_some()); #[cfg(feature = "gecko")] debug_assert!(parent_style.is_none() || - ptr::eq(parent_style.unwrap(), - parent_style_ignoring_first_line.unwrap()) || + ::std::ptr::eq(parent_style.unwrap(), + parent_style_ignoring_first_line.unwrap()) || parent_style.unwrap().pseudo() == Some(PseudoElement::FirstLine)); let (inherited_style, layout_parent_style) = match parent_style { Some(parent_style) => {