diff options
108 files changed, 150 insertions, 128 deletions
diff --git a/Cargo.lock b/Cargo.lock index 0bb6497230f..8192eedc00b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1024,6 +1024,7 @@ dependencies = [ "nsstring_vendor 0.1.0", "parking_lot 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "selectors 0.19.0", + "servo_arc 0.0.1", "style 0.0.1", "style_traits 0.0.1", "stylo_tests 0.0.1", @@ -1063,6 +1064,7 @@ dependencies = [ "range 0.0.1", "serde 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "servo-fontconfig 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "servo_arc 0.0.1", "servo_atoms 0.0.1", "servo_geometry 0.0.1", "servo_url 0.0.1", @@ -1461,6 +1463,7 @@ dependencies = [ "selectors 0.19.0", "serde 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "servo_arc 0.0.1", "servo_atoms 0.0.1", "servo_config 0.0.1", "servo_geometry 0.0.1", @@ -1509,6 +1512,7 @@ dependencies = [ "script_traits 0.0.1", "selectors 0.19.0", "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "servo_arc 0.0.1", "servo_atoms 0.0.1", "servo_config 0.0.1", "servo_geometry 0.0.1", @@ -2470,6 +2474,7 @@ dependencies = [ "selectors 0.19.0", "serde 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "servo_arc 0.0.1", "servo_atoms 0.0.1", "servo_config 0.0.1", "servo_geometry 0.0.1", @@ -2513,6 +2518,7 @@ dependencies = [ "range 0.0.1", "script_traits 0.0.1", "selectors 0.19.0", + "servo_arc 0.0.1", "servo_atoms 0.0.1", "servo_url 0.0.1", "style 0.0.1", @@ -3029,6 +3035,7 @@ dependencies = [ "rayon 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "selectors 0.19.0", + "servo_arc 0.0.1", "servo_atoms 0.0.1", "servo_config 0.0.1", "servo_url 0.0.1", diff --git a/components/gfx/Cargo.toml b/components/gfx/Cargo.toml index 443cc44d567..57f74e4591b 100644 --- a/components/gfx/Cargo.toml +++ b/components/gfx/Cargo.toml @@ -29,6 +29,7 @@ net_traits = {path = "../net_traits"} ordered-float = "0.4" range = {path = "../range"} serde = "1.0" +servo_arc = {path = "../servo_arc"} servo_atoms = {path = "../atoms"} servo_geometry = {path = "../geometry"} servo_url = {path = "../url"} diff --git a/components/gfx/font_context.rs b/components/gfx/font_context.rs index de18c7dcf0a..289939ee9d5 100644 --- a/components/gfx/font_context.rs +++ b/components/gfx/font_context.rs @@ -11,6 +11,7 @@ use heapsize::HeapSizeOf; use platform::font::FontHandle; use platform::font_context::FontContextHandle; use platform::font_template::FontTemplateData; +use servo_arc::Arc as ServoArc; use smallvec::SmallVec; use std::cell::RefCell; use std::collections::HashMap; @@ -21,7 +22,6 @@ use std::sync::Arc; use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT}; use style::computed_values::{font_style, font_variant_caps}; use style::properties::style_structs; -use style::stylearc::Arc as StyleArc; use webrender_api; static SMALL_CAPS_SCALE_FACTOR: f32 = 0.8; // Matches FireFox (see gfxFont.h) @@ -110,7 +110,7 @@ impl FontContext { /// Create a group of fonts for use in layout calculations. May return /// a cached font if this font instance has already been used by /// this context. - pub fn layout_font_group_for_style(&mut self, style: StyleArc<style_structs::Font>) + pub fn layout_font_group_for_style(&mut self, style: ServoArc<style_structs::Font>) -> Rc<FontGroup> { self.expire_font_caches_if_necessary(); @@ -240,7 +240,7 @@ impl HeapSizeOf for FontContext { #[derive(Debug)] struct LayoutFontGroupCacheKey { - pointer: StyleArc<style_structs::Font>, + pointer: ServoArc<style_structs::Font>, size: Au, } diff --git a/components/gfx/lib.rs b/components/gfx/lib.rs index 5a5de4da89e..ce24b697444 100644 --- a/components/gfx/lib.rs +++ b/components/gfx/lib.rs @@ -52,6 +52,7 @@ extern crate net_traits; extern crate ordered_float; extern crate range; #[macro_use] extern crate serde; +extern crate servo_arc; extern crate servo_geometry; extern crate servo_url; #[macro_use] extern crate servo_atoms; diff --git a/components/layout/Cargo.toml b/components/layout/Cargo.toml index 35860b3f236..8a77e23f5aa 100644 --- a/components/layout/Cargo.toml +++ b/components/layout/Cargo.toml @@ -34,6 +34,7 @@ script_layout_interface = {path = "../script_layout_interface"} script_traits = {path = "../script_traits"} selectors = { path = "../selectors" } serde = "1.0" +servo_arc = {path = "../servo_arc"} servo_atoms = {path = "../atoms"} servo_geometry = {path = "../geometry"} serde_json = "1.0" diff --git a/components/layout/block.rs b/components/layout/block.rs index 3ae8a439a4d..f42b749e7a3 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -2139,7 +2139,7 @@ impl Flow for BlockFlow { self.build_display_list_for_block(state, BorderPaintingMode::Separate); } - fn repair_style(&mut self, new_style: &::StyleArc<ComputedValues>) { + fn repair_style(&mut self, new_style: &::ServoArc<ComputedValues>) { self.fragment.repair_style(new_style) } diff --git a/components/layout/construct.rs b/components/layout/construct.rs index cfb92ebc78a..c863219941e 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -13,7 +13,7 @@ #![deny(unsafe_code)] -use StyleArc; +use ServoArc; use app_units::Au; use block::BlockFlow; use context::{LayoutContext, with_thread_local_font_context}; @@ -109,7 +109,7 @@ pub enum ConstructionItem { /// Inline fragments and associated {ib} splits that have not yet found flows. InlineFragments(InlineFragmentsConstructionResult), /// Potentially ignorable whitespace. - Whitespace(OpaqueNode, PseudoElementType<()>, StyleArc<ComputedValues>, RestyleDamage), + Whitespace(OpaqueNode, PseudoElementType<()>, ServoArc<ComputedValues>, RestyleDamage), /// TableColumn Fragment TableColumnFragment(Fragment), } @@ -677,7 +677,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode> fn create_fragments_for_node_text_content(&self, fragments: &mut IntermediateInlineFragments, node: &ConcreteThreadSafeLayoutNode, - style: &StyleArc<ComputedValues>) { + style: &ServoArc<ComputedValues>) { // Fast path: If there is no text content, return immediately. let text_content = node.text_content(); if text_content.is_empty() { @@ -1806,7 +1806,7 @@ pub fn strip_ignorable_whitespace_from_end(this: &mut LinkedList<Fragment>) { /// If the 'unicode-bidi' property has a value other than 'normal', return the bidi control codes /// to inject before and after the text content of the element. -fn bidi_control_chars(style: &StyleArc<ComputedValues>) -> Option<(&'static str, &'static str)> { +fn bidi_control_chars(style: &ServoArc<ComputedValues>) -> Option<(&'static str, &'static str)> { use style::computed_values::direction::T::*; use style::computed_values::unicode_bidi::T::*; diff --git a/components/layout/flex.rs b/components/layout/flex.rs index 6b2e5d3425a..353c939f58b 100644 --- a/components/layout/flex.rs +++ b/components/layout/flex.rs @@ -973,7 +973,7 @@ impl Flow for FlexFlow { self.block_flow.collect_stacking_contexts(state); } - fn repair_style(&mut self, new_style: &::StyleArc<ComputedValues>) { + fn repair_style(&mut self, new_style: &::ServoArc<ComputedValues>) { self.block_flow.repair_style(new_style) } diff --git a/components/layout/flow.rs b/components/layout/flow.rs index 3ce8de5ec98..846b7be8326 100644 --- a/components/layout/flow.rs +++ b/components/layout/flow.rs @@ -424,7 +424,7 @@ pub trait Flow: fmt::Debug + Sync + Send + 'static { /// Attempts to perform incremental fixup of this flow by replacing its fragment's style with /// the new style. This can only succeed if the flow has exactly one fragment. - fn repair_style(&mut self, new_style: &::StyleArc<ComputedValues>); + fn repair_style(&mut self, new_style: &::ServoArc<ComputedValues>); /// Print any extra children (such as fragments) contained in this Flow /// for debugging purposes. Any items inserted into the tree will become @@ -561,7 +561,7 @@ pub trait MutableFlowUtils { /// Calls `repair_style` and `bubble_inline_sizes`. You should use this method instead of /// calling them individually, since there is no reason not to perform both operations. - fn repair_style_and_bubble_inline_sizes(self, style: &::StyleArc<ComputedValues>); + fn repair_style_and_bubble_inline_sizes(self, style: &::ServoArc<ComputedValues>); } pub trait MutableOwnedFlowUtils { @@ -1381,7 +1381,7 @@ impl<'a> MutableFlowUtils for &'a mut Flow { /// Calls `repair_style` and `bubble_inline_sizes`. You should use this method instead of /// calling them individually, since there is no reason not to perform both operations. - fn repair_style_and_bubble_inline_sizes(self, style: &::StyleArc<ComputedValues>) { + fn repair_style_and_bubble_inline_sizes(self, style: &::ServoArc<ComputedValues>) { self.repair_style(style); mut_base(self).update_flags_if_needed(style); self.bubble_inline_sizes(); diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index 9e7eaf6c72f..bd7d06be627 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -6,7 +6,7 @@ #![deny(unsafe_code)] -use StyleArc; +use ServoArc; use app_units::Au; use canvas_traits::CanvasMsg; use context::{LayoutContext, with_thread_local_font_context}; @@ -95,10 +95,10 @@ pub struct Fragment { pub node: OpaqueNode, /// The CSS style of this fragment. - pub style: StyleArc<ComputedValues>, + pub style: ServoArc<ComputedValues>, /// The CSS style of this fragment when it's selected - pub selected_style: StyleArc<ComputedValues>, + pub selected_style: ServoArc<ComputedValues>, /// The position of this fragment relative to its owning flow. The size includes padding and /// border, but not margin. @@ -676,8 +676,8 @@ impl Fragment { /// Constructs a new `Fragment` instance from an opaque node. pub fn from_opaque_node_and_style(node: OpaqueNode, pseudo: PseudoElementType<()>, - style: StyleArc<ComputedValues>, - selected_style: StyleArc<ComputedValues>, + style: ServoArc<ComputedValues>, + selected_style: ServoArc<ComputedValues>, mut restyle_damage: RestyleDamage, specific: SpecificFragmentInfo) -> Fragment { @@ -706,7 +706,7 @@ impl Fragment { /// type. For the new anonymous fragment, layout-related values (border box, etc.) are reset to /// initial values. pub fn create_similar_anonymous_fragment(&self, - style: StyleArc<ComputedValues>, + style: ServoArc<ComputedValues>, specific: SpecificFragmentInfo) -> Fragment { let writing_mode = style.writing_mode; @@ -2423,7 +2423,7 @@ impl Fragment { } } - pub fn repair_style(&mut self, new_style: &StyleArc<ComputedValues>) { + pub fn repair_style(&mut self, new_style: &ServoArc<ComputedValues>) { self.style = (*new_style).clone() } diff --git a/components/layout/generated_content.rs b/components/layout/generated_content.rs index 281c5965c9f..21fce5a03c4 100644 --- a/components/layout/generated_content.rs +++ b/components/layout/generated_content.rs @@ -368,7 +368,7 @@ impl Counter { layout_context: &LayoutContext, node: OpaqueNode, pseudo: PseudoElementType<()>, - style: ::StyleArc<ComputedValues>, + style: ::ServoArc<ComputedValues>, list_style_type: list_style_type::T, mode: RenderingMode) -> Option<SpecificFragmentInfo> { @@ -431,7 +431,7 @@ struct CounterValue { fn render_text(layout_context: &LayoutContext, node: OpaqueNode, pseudo: PseudoElementType<()>, - style: ::StyleArc<ComputedValues>, + style: ::ServoArc<ComputedValues>, string: String) -> Option<SpecificFragmentInfo> { let mut fragments = LinkedList::new(); diff --git a/components/layout/inline.rs b/components/layout/inline.rs index 9228c21a7ba..d5813d9bea2 100644 --- a/components/layout/inline.rs +++ b/components/layout/inline.rs @@ -4,7 +4,7 @@ #![deny(unsafe_code)] -use StyleArc; +use ServoArc; use app_units::{Au, MIN_AU}; use block::AbsoluteAssignBSizesTraversal; use context::LayoutContext; @@ -1665,7 +1665,7 @@ impl Flow for InlineFlow { self.build_display_list_for_inline(state); } - fn repair_style(&mut self, _: &StyleArc<ComputedValues>) {} + fn repair_style(&mut self, _: &ServoArc<ComputedValues>) {} fn compute_overflow(&self) -> Overflow { let mut overflow = Overflow::new(); @@ -1754,8 +1754,8 @@ impl fmt::Debug for InlineFlow { #[derive(Clone)] pub struct InlineFragmentNodeInfo { pub address: OpaqueNode, - pub style: StyleArc<ComputedValues>, - pub selected_style: StyleArc<ComputedValues>, + pub style: ServoArc<ComputedValues>, + pub selected_style: ServoArc<ComputedValues>, pub pseudo: PseudoElementType<()>, pub flags: InlineFragmentNodeFlags, } diff --git a/components/layout/lib.rs b/components/layout/lib.rs index 3527c3590cd..9b6e27311cf 100644 --- a/components/layout/lib.rs +++ b/components/layout/lib.rs @@ -36,6 +36,7 @@ extern crate script_layout_interface; extern crate script_traits; #[macro_use] extern crate serde; extern crate serde_json; +extern crate servo_arc; extern crate servo_atoms; extern crate servo_config; extern crate servo_geometry; @@ -91,6 +92,6 @@ pub use fragment::Fragment; pub use fragment::SpecificFragmentInfo; pub use self::data::LayoutData; -// We can't use stylearc for everything in layout, because the Flow stuff uses +// We can't use servo_arc for everything in layout, because the Flow stuff uses // weak references. -use style::stylearc::Arc as StyleArc; +use servo_arc::Arc as ServoArc; diff --git a/components/layout/list_item.rs b/components/layout/list_item.rs index faf8ae259fc..007c7ab0eda 100644 --- a/components/layout/list_item.rs +++ b/components/layout/list_item.rs @@ -147,7 +147,7 @@ impl Flow for ListItemFlow { self.block_flow.collect_stacking_contexts(state); } - fn repair_style(&mut self, new_style: &::StyleArc<ComputedValues>) { + fn repair_style(&mut self, new_style: &::ServoArc<ComputedValues>) { self.block_flow.repair_style(new_style) } diff --git a/components/layout/multicol.rs b/components/layout/multicol.rs index 739341ab4e3..3321faae926 100644 --- a/components/layout/multicol.rs +++ b/components/layout/multicol.rs @@ -6,7 +6,7 @@ #![deny(unsafe_code)] -use StyleArc; +use ServoArc; use app_units::Au; use block::BlockFlow; use context::LayoutContext; @@ -193,7 +193,7 @@ impl Flow for MulticolFlow { self.block_flow.collect_stacking_contexts(state); } - fn repair_style(&mut self, new_style: &StyleArc<ComputedValues>) { + fn repair_style(&mut self, new_style: &ServoArc<ComputedValues>) { self.block_flow.repair_style(new_style) } @@ -275,7 +275,7 @@ impl Flow for MulticolColumnFlow { self.block_flow.collect_stacking_contexts(state); } - fn repair_style(&mut self, new_style: &StyleArc<ComputedValues>) { + fn repair_style(&mut self, new_style: &ServoArc<ComputedValues>) { self.block_flow.repair_style(new_style) } diff --git a/components/layout/table.rs b/components/layout/table.rs index 809e2ac4e29..7010acf1b87 100644 --- a/components/layout/table.rs +++ b/components/layout/table.rs @@ -506,7 +506,7 @@ impl Flow for TableFlow { self.block_flow.collect_stacking_contexts(state); } - fn repair_style(&mut self, new_style: &::StyleArc<ComputedValues>) { + fn repair_style(&mut self, new_style: &::ServoArc<ComputedValues>) { self.block_flow.repair_style(new_style) } diff --git a/components/layout/table_caption.rs b/components/layout/table_caption.rs index c225339b082..c421b4a8e91 100644 --- a/components/layout/table_caption.rs +++ b/components/layout/table_caption.rs @@ -83,7 +83,7 @@ impl Flow for TableCaptionFlow { self.block_flow.collect_stacking_contexts(state); } - fn repair_style(&mut self, new_style: &::StyleArc<ComputedValues>) { + fn repair_style(&mut self, new_style: &::ServoArc<ComputedValues>) { self.block_flow.repair_style(new_style) } diff --git a/components/layout/table_cell.rs b/components/layout/table_cell.rs index 6ba7667a0a9..7ef02e28db6 100644 --- a/components/layout/table_cell.rs +++ b/components/layout/table_cell.rs @@ -263,7 +263,7 @@ impl Flow for TableCellFlow { self.block_flow.collect_stacking_contexts(state); } - fn repair_style(&mut self, new_style: &::StyleArc<ComputedValues>) { + fn repair_style(&mut self, new_style: &::ServoArc<ComputedValues>) { self.block_flow.repair_style(new_style) } diff --git a/components/layout/table_colgroup.rs b/components/layout/table_colgroup.rs index 4967f19ee73..44519a3bbab 100644 --- a/components/layout/table_colgroup.rs +++ b/components/layout/table_colgroup.rs @@ -94,7 +94,7 @@ impl Flow for TableColGroupFlow { fn collect_stacking_contexts(&mut self, _: &mut DisplayListBuildState) {} - fn repair_style(&mut self, _: &::StyleArc<ComputedValues>) {} + fn repair_style(&mut self, _: &::ServoArc<ComputedValues>) {} fn compute_overflow(&self) -> Overflow { Overflow::new() diff --git a/components/layout/table_row.rs b/components/layout/table_row.rs index cc683096831..e960290bdd2 100644 --- a/components/layout/table_row.rs +++ b/components/layout/table_row.rs @@ -481,7 +481,7 @@ impl Flow for TableRowFlow { self.block_flow.collect_stacking_contexts(state); } - fn repair_style(&mut self, new_style: &::StyleArc<ComputedValues>) { + fn repair_style(&mut self, new_style: &::ServoArc<ComputedValues>) { self.block_flow.repair_style(new_style) } diff --git a/components/layout/table_rowgroup.rs b/components/layout/table_rowgroup.rs index 779832923d0..b609276f7a2 100644 --- a/components/layout/table_rowgroup.rs +++ b/components/layout/table_rowgroup.rs @@ -185,7 +185,7 @@ impl Flow for TableRowGroupFlow { self.block_flow.collect_stacking_contexts(state); } - fn repair_style(&mut self, new_style: &::StyleArc<ComputedValues>) { + fn repair_style(&mut self, new_style: &::ServoArc<ComputedValues>) { self.block_flow.repair_style(new_style) } diff --git a/components/layout/table_wrapper.rs b/components/layout/table_wrapper.rs index ac0e6025c67..eec409c8e99 100644 --- a/components/layout/table_wrapper.rs +++ b/components/layout/table_wrapper.rs @@ -466,7 +466,7 @@ impl Flow for TableWrapperFlow { self.block_flow.collect_stacking_contexts(state); } - fn repair_style(&mut self, new_style: &::StyleArc<ComputedValues>) { + fn repair_style(&mut self, new_style: &::ServoArc<ComputedValues>) { self.block_flow.repair_style(new_style) } diff --git a/components/layout/text.rs b/components/layout/text.rs index ab2f941fc03..6e1c7b2a43a 100644 --- a/components/layout/text.rs +++ b/components/layout/text.rs @@ -436,7 +436,7 @@ fn bounding_box_for_run_metrics(metrics: &RunMetrics, writing_mode: WritingMode) /// /// `#[inline]` because often the caller only needs a few fields from the font metrics. #[inline] -pub fn font_metrics_for_style(font_context: &mut FontContext, font_style: ::StyleArc<style_structs::Font>) +pub fn font_metrics_for_style(font_context: &mut FontContext, font_style: ::ServoArc<style_structs::Font>) -> FontMetrics { let fontgroup = font_context.layout_font_group_for_style(font_style); // FIXME(https://github.com/rust-lang/rust/issues/23338) diff --git a/components/layout_thread/Cargo.toml b/components/layout_thread/Cargo.toml index e1d93d2cbc9..883205bca28 100644 --- a/components/layout_thread/Cargo.toml +++ b/components/layout_thread/Cargo.toml @@ -34,6 +34,7 @@ script_layout_interface = {path = "../script_layout_interface"} script_traits = {path = "../script_traits"} selectors = { path = "../selectors" } serde_json = "1.0" +servo_arc = {path = "../servo_arc"} servo_atoms = {path = "../atoms"} servo_config = {path = "../config"} servo_geometry = {path = "../geometry"} diff --git a/components/layout_thread/dom_wrapper.rs b/components/layout_thread/dom_wrapper.rs index 00e73df2b25..667e087c69c 100644 --- a/components/layout_thread/dom_wrapper.rs +++ b/components/layout_thread/dom_wrapper.rs @@ -54,6 +54,7 @@ use selectors::attr::{AttrSelectorOperation, NamespaceConstraint, CaseSensitivit use selectors::matching::{ElementSelectorFlags, LocalMatchingContext, MatchingContext, RelevantLinkStatus}; use selectors::matching::VisitedHandlingMode; use selectors::sink::Push; +use servo_arc::{Arc, ArcBorrow}; use servo_atoms::Atom; use servo_url::ServoUrl; use std::fmt; @@ -78,7 +79,6 @@ use style::selector_parser::{AttrValue as SelectorAttrValue, NonTSPseudoClass, P use style::selector_parser::{PseudoElement, SelectorImpl, extended_filtering}; use style::shared_lock::{SharedRwLock as StyleSharedRwLock, Locked as StyleLocked}; use style::str::is_whitespace; -use style::stylearc::{Arc, ArcBorrow}; pub unsafe fn drop_style_and_layout_data(data: OpaqueStyleAndLayoutData) { let ptr: *mut StyleData = data.ptr.get(); diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index b8436ce0bbf..f8ff4af9cfa 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -39,6 +39,7 @@ extern crate script_layout_interface; extern crate script_traits; extern crate selectors; extern crate serde_json; +extern crate servo_arc; extern crate servo_atoms; extern crate servo_config; extern crate servo_geometry; @@ -97,6 +98,7 @@ use script_layout_interface::wrapper_traits::LayoutNode; use script_traits::{ConstellationControlMsg, LayoutControlMsg, LayoutMsg as ConstellationMsg}; use script_traits::{ScrollState, UntrustedNodeAddress}; use selectors::Element; +use servo_arc::Arc as ServoArc; use servo_atoms::Atom; use servo_config::opts; use servo_config::prefs::PREFS; @@ -127,7 +129,6 @@ use style::properties::PropertyId; use style::selector_parser::SnapshotMap; use style::servo::restyle_damage::{REFLOW, REFLOW_OUT_OF_FLOW, REPAINT, REPOSITION, STORE_OVERFLOW}; use style::shared_lock::{SharedRwLock, SharedRwLockReadGuard, StylesheetGuards}; -use style::stylearc::Arc as StyleArc; use style::stylesheets::{Origin, Stylesheet, StylesheetInDocument, UserAgentStylesheets}; use style::stylist::{ExtraStyleData, Stylist}; use style::thread_state; @@ -211,10 +212,10 @@ pub struct LayoutThread { document_shared_lock: Option<SharedRwLock>, /// The list of currently-running animations. - running_animations: StyleArc<RwLock<FnvHashMap<OpaqueNode, Vec<Animation>>>>, + running_animations: ServoArc<RwLock<FnvHashMap<OpaqueNode, Vec<Animation>>>>, /// The list of animations that have expired since the last style recalculation. - expired_animations: StyleArc<RwLock<FnvHashMap<OpaqueNode, Vec<Animation>>>>, + expired_animations: ServoArc<RwLock<FnvHashMap<OpaqueNode, Vec<Animation>>>>, /// A counter for epoch messages epoch: Cell<Epoch>, @@ -426,7 +427,7 @@ fn add_font_face_rules(stylesheet: &Stylesheet, } #[derive(Clone)] -struct StylesheetIterator<'a>(slice::Iter<'a, StyleArc<Stylesheet>>); +struct StylesheetIterator<'a>(slice::Iter<'a, ServoArc<Stylesheet>>); impl<'a> Iterator for StylesheetIterator<'a> { type Item = &'a Stylesheet; @@ -515,8 +516,8 @@ impl LayoutThread { outstanding_web_fonts: outstanding_web_fonts_counter, root_flow: RefCell::new(None), document_shared_lock: None, - running_animations: StyleArc::new(RwLock::new(FnvHashMap::default())), - expired_animations: StyleArc::new(RwLock::new(FnvHashMap::default())), + running_animations: ServoArc::new(RwLock::new(FnvHashMap::default())), + expired_animations: ServoArc::new(RwLock::new(FnvHashMap::default())), epoch: Cell::new(Epoch(0)), viewport_size: Size2D::new(Au(0), Au(0)), webrender_api: webrender_api_sender.create_api(), @@ -825,7 +826,7 @@ impl LayoutThread { } fn handle_add_stylesheet<'a, 'b>(&self, - stylesheet: StyleArc<Stylesheet>, + stylesheet: ServoArc<Stylesheet>, possibly_locked_rw_data: &mut RwData<'a, 'b>) { // Find all font-face rules and notify the font cache of them. // GWTODO: Need to handle unloading web fonts. diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml index eae31b8fef0..c98f11e90ac 100644 --- a/components/script/Cargo.toml +++ b/components/script/Cargo.toml @@ -74,6 +74,7 @@ script_plugins = {path = "../script_plugins"} script_traits = {path = "../script_traits"} selectors = { path = "../selectors" } serde = "1.0" +servo_arc = {path = "../servo_arc"} servo_atoms = {path = "../atoms"} servo_config = {path = "../config"} servo_geometry = {path = "../geometry" } diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs index d73d65026f9..232ef20ec16 100644 --- a/components/script/dom/bindings/trace.rs +++ b/components/script/dom/bindings/trace.rs @@ -77,6 +77,7 @@ use script_traits::{DocumentActivity, TimerEventId, TimerSource, TouchpadPressur use script_traits::{UntrustedNodeAddress, WindowSizeData, WindowSizeType}; use selectors::matching::ElementSelectorFlags; use serde::{Deserialize, Serialize}; +use servo_arc::Arc as ServoArc; use servo_atoms::Atom; use servo_url::{ImmutableOrigin, MutableOrigin, ServoUrl}; use smallvec::SmallVec; @@ -97,7 +98,6 @@ use style::media_queries::MediaList; use style::properties::PropertyDeclarationBlock; use style::selector_parser::{PseudoElement, Snapshot}; use style::shared_lock::{SharedRwLock as StyleSharedRwLock, Locked as StyleLocked}; -use style::stylearc::Arc as StyleArc; use style::stylesheets::{CssRules, FontFaceRule, KeyframesRule, MediaRule}; use style::stylesheets::{NamespaceRule, StyleRule, ImportRule, SupportsRule, ViewportRule}; use style::stylesheets::keyframes_rule::Keyframe; @@ -165,7 +165,7 @@ unsafe impl<T: JSTraceable> JSTraceable for Arc<T> { } } -unsafe impl<T: JSTraceable> JSTraceable for StyleArc<T> { +unsafe impl<T: JSTraceable> JSTraceable for ServoArc<T> { unsafe fn trace(&self, trc: *mut JSTracer) { (**self).trace(trc) } diff --git a/components/script/dom/cssconditionrule.rs b/components/script/dom/cssconditionrule.rs index 1944c28c379..e27d2323282 100644 --- a/components/script/dom/cssconditionrule.rs +++ b/components/script/dom/cssconditionrule.rs @@ -10,8 +10,8 @@ use dom::cssmediarule::CSSMediaRule; use dom::cssstylesheet::CSSStyleSheet; use dom::csssupportsrule::CSSSupportsRule; use dom_struct::dom_struct; +use servo_arc::Arc; use style::shared_lock::{SharedRwLock, Locked}; -use style::stylearc::Arc; use style::stylesheets::CssRules as StyleCssRules; #[dom_struct] diff --git a/components/script/dom/cssfontfacerule.rs b/components/script/dom/cssfontfacerule.rs index 560722d2452..366a28c84d1 100644 --- a/components/script/dom/cssfontfacerule.rs +++ b/components/script/dom/cssfontfacerule.rs @@ -10,8 +10,8 @@ use dom::cssrule::{CSSRule, SpecificCSSRule}; use dom::cssstylesheet::CSSStyleSheet; use dom::window::Window; use dom_struct::dom_struct; +use servo_arc::Arc; use style::shared_lock::{Locked, ToCssWithGuard}; -use style::stylearc::Arc; use style::stylesheets::FontFaceRule; #[dom_struct] diff --git a/components/script/dom/cssgroupingrule.rs b/components/script/dom/cssgroupingrule.rs index 4fd77b46a7c..580c6f05b0d 100644 --- a/components/script/dom/cssgroupingrule.rs +++ b/components/script/dom/cssgroupingrule.rs @@ -12,8 +12,8 @@ use dom::cssrule::CSSRule; use dom::cssrulelist::{CSSRuleList, RulesSource}; use dom::cssstylesheet::CSSStyleSheet; use dom_struct::dom_struct; +use servo_arc::Arc; use style::shared_lock::{SharedRwLock, Locked}; -use style::stylearc::Arc; use style::stylesheets::CssRules as StyleCssRules; #[dom_struct] diff --git a/components/script/dom/cssimportrule.rs b/components/script/dom/cssimportrule.rs index d9d867cbc19..1467019cb84 100644 --- a/components/script/dom/cssimportrule.rs +++ b/components/script/dom/cssimportrule.rs @@ -10,8 +10,8 @@ use dom::cssrule::{CSSRule, SpecificCSSRule}; use dom::cssstylesheet::CSSStyleSheet; use dom::window::Window; use dom_struct::dom_struct; +use servo_arc::Arc; use style::shared_lock::{Locked, ToCssWithGuard}; -use style::stylearc::Arc; use style::stylesheets::ImportRule; #[dom_struct] diff --git a/components/script/dom/csskeyframerule.rs b/components/script/dom/csskeyframerule.rs index bd8b0a47fc0..e46152700ce 100644 --- a/components/script/dom/csskeyframerule.rs +++ b/components/script/dom/csskeyframerule.rs @@ -12,8 +12,8 @@ use dom::cssstyledeclaration::{CSSModificationAccess, CSSStyleDeclaration, CSSSt use dom::cssstylesheet::CSSStyleSheet; use dom::window::Window; use dom_struct::dom_struct; +use servo_arc::Arc; use style::shared_lock::{Locked, ToCssWithGuard}; -use style::stylearc::Arc; use style::stylesheets::keyframes_rule::Keyframe; #[dom_struct] diff --git a/components/script/dom/csskeyframesrule.rs b/components/script/dom/csskeyframesrule.rs index 888f945caa7..0e4b2e4eaaa 100644 --- a/components/script/dom/csskeyframesrule.rs +++ b/components/script/dom/csskeyframesrule.rs @@ -16,8 +16,8 @@ use dom::cssrulelist::{CSSRuleList, RulesSource}; use dom::cssstylesheet::CSSStyleSheet; use dom::window::Window; use dom_struct::dom_struct; +use servo_arc::Arc; use style::shared_lock::{Locked, ToCssWithGuard}; -use style::stylearc::Arc; use style::stylesheets::keyframes_rule::{KeyframesRule, Keyframe, KeyframeSelector}; use style::values::KeyframesName; diff --git a/components/script/dom/cssmediarule.rs b/components/script/dom/cssmediarule.rs index 3c27127ecf4..d9855baec02 100644 --- a/components/script/dom/cssmediarule.rs +++ b/components/script/dom/cssmediarule.rs @@ -15,10 +15,10 @@ use dom::cssstylesheet::CSSStyleSheet; use dom::medialist::MediaList; use dom::window::Window; use dom_struct::dom_struct; +use servo_arc::Arc; use style::media_queries::parse_media_query_list; use style::parser::ParserContext; use style::shared_lock::{Locked, ToCssWithGuard}; -use style::stylearc::Arc; use style::stylesheets::{CssRuleType, MediaRule}; use style_traits::{PARSING_MODE_DEFAULT, ToCss}; diff --git a/components/script/dom/cssnamespacerule.rs b/components/script/dom/cssnamespacerule.rs index eafabf8a4a6..e7cecb2ebe7 100644 --- a/components/script/dom/cssnamespacerule.rs +++ b/components/script/dom/cssnamespacerule.rs @@ -11,8 +11,8 @@ use dom::cssrule::{CSSRule, SpecificCSSRule}; use dom::cssstylesheet::CSSStyleSheet; use dom::window::Window; use dom_struct::dom_struct; +use servo_arc::Arc; use style::shared_lock::{Locked, ToCssWithGuard}; -use style::stylearc::Arc; use style::stylesheets::NamespaceRule; #[dom_struct] diff --git a/components/script/dom/cssrulelist.rs b/components/script/dom/cssrulelist.rs index 78ec43e5c51..63420f26608 100644 --- a/components/script/dom/cssrulelist.rs +++ b/components/script/dom/cssrulelist.rs @@ -13,8 +13,8 @@ use dom::cssrule::CSSRule; use dom::cssstylesheet::CSSStyleSheet; use dom::window::Window; use dom_struct::dom_struct; +use servo_arc::Arc; use style::shared_lock::Locked; -use style::stylearc::Arc; use style::stylesheets::{CssRules, CssRulesHelpers, KeyframesRule, RulesMutateError}; #[allow(unsafe_code)] diff --git a/components/script/dom/cssstyledeclaration.rs b/components/script/dom/cssstyledeclaration.rs index 81dec4d3aa8..0732c9af9e4 100644 --- a/components/script/dom/cssstyledeclaration.rs +++ b/components/script/dom/cssstyledeclaration.rs @@ -14,6 +14,7 @@ use dom::element::Element; use dom::node::{Node, window_from_node, document_from_node}; use dom::window::Window; use dom_struct::dom_struct; +use servo_arc::Arc; use servo_url::ServoUrl; use std::ascii::AsciiExt; use style::attr::AttrValue; @@ -21,7 +22,6 @@ use style::properties::{Importance, PropertyDeclarationBlock, PropertyId, Longha use style::properties::{parse_one_declaration_into, parse_style_attribute, SourcePropertyDeclaration}; use style::selector_parser::PseudoElement; use style::shared_lock::Locked; -use style::stylearc::Arc; use style_traits::{PARSING_MODE_DEFAULT, ToCss}; // http://dev.w3.org/csswg/cssom/#the-cssstyledeclaration-interface diff --git a/components/script/dom/cssstylerule.rs b/components/script/dom/cssstylerule.rs index f9df3afc2ad..ea121ef900a 100644 --- a/components/script/dom/cssstylerule.rs +++ b/components/script/dom/cssstylerule.rs @@ -16,10 +16,10 @@ use dom::cssstylesheet::CSSStyleSheet; use dom::window::Window; use dom_struct::dom_struct; use selectors::parser::SelectorList; +use servo_arc::Arc; use std::mem; use style::selector_parser::SelectorParser; use style::shared_lock::{Locked, ToCssWithGuard}; -use style::stylearc::Arc; use style::stylesheets::{StyleRule, Origin}; #[dom_struct] diff --git a/components/script/dom/cssstylesheet.rs b/components/script/dom/cssstylesheet.rs index 8d42d8c7b6d..7a1634aa734 100644 --- a/components/script/dom/cssstylesheet.rs +++ b/components/script/dom/cssstylesheet.rs @@ -14,9 +14,9 @@ use dom::element::Element; use dom::stylesheet::StyleSheet; use dom::window::Window; use dom_struct::dom_struct; +use servo_arc::Arc; use std::cell::Cell; use style::shared_lock::SharedRwLock; -use style::stylearc::Arc; use style::stylesheets::Stylesheet as StyleStyleSheet; #[dom_struct] diff --git a/components/script/dom/csssupportsrule.rs b/components/script/dom/csssupportsrule.rs index 73503d0dfa6..5739a53421a 100644 --- a/components/script/dom/csssupportsrule.rs +++ b/components/script/dom/csssupportsrule.rs @@ -13,9 +13,9 @@ use dom::cssrule::SpecificCSSRule; use dom::cssstylesheet::CSSStyleSheet; use dom::window::Window; use dom_struct::dom_struct; +use servo_arc::Arc; use style::parser::ParserContext; use style::shared_lock::{Locked, ToCssWithGuard}; -use style::stylearc::Arc; use style::stylesheets::{CssRuleType, SupportsRule}; use style::stylesheets::supports_rule::SupportsCondition; use style_traits::{PARSING_MODE_DEFAULT, ToCss}; diff --git a/components/script/dom/cssviewportrule.rs b/components/script/dom/cssviewportrule.rs index a3b259a4ab5..c9acead9bd2 100644 --- a/components/script/dom/cssviewportrule.rs +++ b/components/script/dom/cssviewportrule.rs @@ -10,8 +10,8 @@ use dom::cssrule::{CSSRule, SpecificCSSRule}; use dom::cssstylesheet::CSSStyleSheet; use dom::window::Window; use dom_struct::dom_struct; +use servo_arc::Arc; use style::shared_lock::{Locked, ToCssWithGuard}; -use style::stylearc::Arc; use style::stylesheets::ViewportRule; #[dom_struct] diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 2d95efbc294..8390b5371fd 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -118,6 +118,7 @@ use script_traits::{MouseButton, MouseEventType, MozBrowserEvent}; use script_traits::{MsDuration, ScriptMsg as ConstellationMsg, TouchpadPressurePhase}; use script_traits::{TouchEventType, TouchId}; use script_traits::UntrustedNodeAddress; +use servo_arc::Arc; use servo_atoms::Atom; use servo_config::prefs::PREFS; use servo_url::{ImmutableOrigin, MutableOrigin, ServoUrl}; @@ -137,7 +138,6 @@ use style::invalidation::element::restyle_hints::{RestyleHint, RESTYLE_SELF, RES use style::selector_parser::{RestyleDamage, Snapshot}; use style::shared_lock::SharedRwLock as StyleSharedRwLock; use style::str::{HTML_SPACE_CHARACTERS, split_html_space_chars, str_join}; -use style::stylearc::Arc; use style::stylesheets::Stylesheet; use task_source::TaskSource; use time; diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index c43f7ffdd95..59db577c4eb 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -93,6 +93,7 @@ use selectors::matching::{ElementSelectorFlags, LocalMatchingContext, MatchingCo use selectors::matching::{HAS_EDGE_CHILD_SELECTOR, HAS_SLOW_SELECTOR, HAS_SLOW_SELECTOR_LATER_SIBLINGS}; use selectors::matching::{RelevantLinkStatus, matches_selector_list}; use selectors::sink::Push; +use servo_arc::Arc; use servo_atoms::Atom; use std::ascii::AsciiExt; use std::borrow::Cow; @@ -113,7 +114,6 @@ use style::rule_tree::CascadeLevel; use style::selector_parser::{NonTSPseudoClass, PseudoElement, RestyleDamage, SelectorImpl, SelectorParser}; use style::selector_parser::extended_filtering; use style::shared_lock::{SharedRwLock, Locked}; -use style::stylearc::Arc; use style::thread_state; use style::values::{CSSFloat, Either}; use style::values::{specified, computed}; diff --git a/components/script/dom/htmllinkelement.rs b/components/script/dom/htmllinkelement.rs index ff004261db5..8175da5c913 100644 --- a/components/script/dom/htmllinkelement.rs +++ b/components/script/dom/htmllinkelement.rs @@ -26,6 +26,7 @@ use html5ever::{LocalName, Prefix}; use net_traits::ReferrerPolicy; use script_layout_interface::message::Msg; use script_traits::{MozBrowserEvent, ScriptMsg as ConstellationMsg}; +use servo_arc::Arc; use std::ascii::AsciiExt; use std::borrow::ToOwned; use std::cell::Cell; @@ -34,7 +35,6 @@ use style::attr::AttrValue; use style::media_queries::parse_media_query_list; use style::parser::ParserContext as CssParserContext; use style::str::HTML_SPACE_CHARACTERS; -use style::stylearc::Arc; use style::stylesheets::{CssRuleType, Stylesheet}; use style_traits::PARSING_MODE_DEFAULT; use stylesheet_loader::{StylesheetLoader, StylesheetContextSource, StylesheetOwner}; diff --git a/components/script/dom/htmlmetaelement.rs b/components/script/dom/htmlmetaelement.rs index a4c22bc9a82..9370675eb6b 100644 --- a/components/script/dom/htmlmetaelement.rs +++ b/components/script/dom/htmlmetaelement.rs @@ -20,13 +20,13 @@ use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; use html5ever::{LocalName, Prefix}; use parking_lot::RwLock; +use servo_arc::Arc; use servo_config::prefs::PREFS; use std::ascii::AsciiExt; use std::sync::atomic::AtomicBool; use style::attr::AttrValue; use style::media_queries::MediaList; use style::str::HTML_SPACE_CHARACTERS; -use style::stylearc::Arc; use style::stylesheets::{Stylesheet, StylesheetContents, CssRule, CssRules, Origin, ViewportRule}; #[dom_struct] diff --git a/components/script/dom/htmlobjectelement.rs b/components/script/dom/htmlobjectelement.rs index 28ce00942cc..4c7d54c2f1f 100755 --- a/components/script/dom/htmlobjectelement.rs +++ b/components/script/dom/htmlobjectelement.rs @@ -20,8 +20,8 @@ use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; use html5ever::{LocalName, Prefix}; use net_traits::image::base::Image; +use servo_arc::Arc; use std::default::Default; -use style::stylearc::Arc; #[dom_struct] pub struct HTMLObjectElement { diff --git a/components/script/dom/htmlstyleelement.rs b/components/script/dom/htmlstyleelement.rs index bbce33f3d52..9c6f34ba7bd 100644 --- a/components/script/dom/htmlstyleelement.rs +++ b/components/script/dom/htmlstyleelement.rs @@ -21,10 +21,10 @@ use dom_struct::dom_struct; use html5ever::{LocalName, Prefix}; use net_traits::ReferrerPolicy; use script_layout_interface::message::Msg; +use servo_arc::Arc; use std::cell::Cell; use style::media_queries::parse_media_query_list; use style::parser::ParserContext as CssParserContext; -use style::stylearc::Arc; use style::stylesheets::{CssRuleType, Stylesheet, Origin}; use style_traits::PARSING_MODE_DEFAULT; use stylesheet_loader::{StylesheetLoader, StylesheetOwner}; diff --git a/components/script/dom/medialist.rs b/components/script/dom/medialist.rs index 55ca57cb4fd..0064d044509 100644 --- a/components/script/dom/medialist.rs +++ b/components/script/dom/medialist.rs @@ -12,11 +12,11 @@ use dom::bindings::str::DOMString; use dom::cssstylesheet::CSSStyleSheet; use dom::window::Window; use dom_struct::dom_struct; +use servo_arc::Arc; use style::media_queries::{MediaQuery, parse_media_query_list}; use style::media_queries::MediaList as StyleMediaList; use style::parser::ParserContext; use style::shared_lock::{SharedRwLock, Locked}; -use style::stylearc::Arc; use style::stylesheets::CssRuleType; use style_traits::{PARSING_MODE_DEFAULT, ToCss}; diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 94ab6f18dc8..d6420b0a6f1 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -72,6 +72,7 @@ use script_traits::DocumentActivity; use script_traits::UntrustedNodeAddress; use selectors::matching::{matches_selector_list, MatchingContext, MatchingMode}; use selectors::parser::SelectorList; +use servo_arc::Arc; use servo_url::ServoUrl; use std::borrow::ToOwned; use std::cell::{Cell, UnsafeCell, RefMut}; @@ -83,7 +84,6 @@ use std::ops::Range; use style::context::QuirksMode; use style::dom::OpaqueNode; use style::selector_parser::{SelectorImpl, SelectorParser}; -use style::stylearc::Arc; use style::stylesheets::Stylesheet; use style::thread_state; use uuid::Uuid; diff --git a/components/script/dom/servoparser/html.rs b/components/script/dom/servoparser/html.rs index 749174d1417..4621faacf54 100644 --- a/components/script/dom/servoparser/html.rs +++ b/components/script/dom/servoparser/html.rs @@ -14,14 +14,14 @@ use dom::documenttype::DocumentType; use dom::element::Element; use dom::htmlscriptelement::HTMLScriptElement; use dom::htmltemplateelement::HTMLTemplateElement; -use dom::node::{Node, TreeIterator}; +use dom::node::Node; use dom::processinginstruction::ProcessingInstruction; use dom::servoparser::Sink; use html5ever::QualName; use html5ever::buffer_queue::BufferQueue; use html5ever::serialize::{AttrRef, Serialize, Serializer}; use html5ever::serialize::TraversalScope; -use html5ever::serialize::TraversalScope::{ChildrenOnly, IncludeNode}; +use html5ever::serialize::TraversalScope::ChildrenOnly; use html5ever::tokenizer::{Tokenizer as HtmlTokenizer, TokenizerOpts, TokenizerResult}; use html5ever::tree_builder::{Tracer as HtmlTracer, TreeBuilder, TreeBuilderOpts}; use js::jsapi::JSTracer; diff --git a/components/script/lib.rs b/components/script/lib.rs index 1966ea6df93..d5d4aef293b 100644 --- a/components/script/lib.rs +++ b/components/script/lib.rs @@ -83,6 +83,7 @@ extern crate script_layout_interface; extern crate script_traits; extern crate selectors; extern crate serde; +extern crate servo_arc; #[macro_use] extern crate servo_atoms; extern crate servo_config; extern crate servo_geometry; diff --git a/components/script/stylesheet_loader.rs b/components/script/stylesheet_loader.rs index 2041a0d91de..888cec43650 100644 --- a/components/script/stylesheet_loader.rs +++ b/components/script/stylesheet_loader.rs @@ -24,6 +24,7 @@ use net_traits::{FetchResponseListener, FetchMetadata, FilteredMetadata, Metadat use net_traits::request::{CorsSettings, CredentialsMode, Destination, RequestInit, RequestMode, Type as RequestType}; use network_listener::{NetworkListener, PreInvoke}; use parking_lot::RwLock; +use servo_arc::Arc; use servo_url::ServoUrl; use std::mem; use std::sync::Mutex; @@ -31,7 +32,6 @@ use std::sync::atomic::AtomicBool; use style::media_queries::MediaList; use style::parser::ParserContext; use style::shared_lock::{Locked, SharedRwLock}; -use style::stylearc::Arc; use style::stylesheets::{CssRules, ImportRule, Namespaces, Stylesheet, StylesheetContents, Origin}; use style::stylesheets::StylesheetLoader as StyleStylesheetLoader; use style::stylesheets::import_rule::ImportSheet; diff --git a/components/script_layout_interface/Cargo.toml b/components/script_layout_interface/Cargo.toml index c28f3d59979..a0db721012a 100644 --- a/components/script_layout_interface/Cargo.toml +++ b/components/script_layout_interface/Cargo.toml @@ -28,6 +28,7 @@ profile_traits = {path = "../profile_traits"} range = {path = "../range"} script_traits = {path = "../script_traits"} selectors = { path = "../selectors" } +servo_arc = {path = "../servo_arc"} servo_atoms = {path = "../atoms"} servo_url = {path = "../url"} style = {path = "../style"} diff --git a/components/script_layout_interface/lib.rs b/components/script_layout_interface/lib.rs index 073ae95978e..210bb1a5c11 100644 --- a/components/script_layout_interface/lib.rs +++ b/components/script_layout_interface/lib.rs @@ -30,6 +30,7 @@ extern crate profile_traits; extern crate range; extern crate script_traits; extern crate selectors; +extern crate servo_arc; extern crate servo_atoms; extern crate servo_url; extern crate style; diff --git a/components/script_layout_interface/message.rs b/components/script_layout_interface/message.rs index 4b1648bb6a2..bd68eaec7a6 100644 --- a/components/script_layout_interface/message.rs +++ b/components/script_layout_interface/message.rs @@ -14,6 +14,7 @@ use rpc::LayoutRPC; use script_traits::{ConstellationControlMsg, LayoutControlMsg, LayoutMsg as ConstellationMsg}; use script_traits::{ScrollState, UntrustedNodeAddress, WindowSizeData}; use script_traits::Painter; +use servo_arc::Arc as ServoArc; use servo_atoms::Atom; use servo_url::ServoUrl; use std::sync::Arc; @@ -26,7 +27,7 @@ use style::stylesheets::Stylesheet; /// Asynchronous messages that script can send to layout. pub enum Msg { /// Adds the given stylesheet to the document. - AddStylesheet(::style::stylearc::Arc<Stylesheet>), + AddStylesheet(ServoArc<Stylesheet>), /// Change the quirks mode. SetQuirksMode(QuirksMode), @@ -133,7 +134,7 @@ pub struct ScriptReflow { /// The document node. pub document: TrustedNodeAddress, /// The document's list of stylesheets. - pub document_stylesheets: Vec<::style::stylearc::Arc<Stylesheet>>, + pub document_stylesheets: Vec<ServoArc<Stylesheet>>, /// Whether the document's stylesheets have changed since the last script reflow. pub stylesheets_changed: bool, /// The current window size. diff --git a/components/script_layout_interface/wrapper_traits.rs b/components/script_layout_interface/wrapper_traits.rs index a32a6e6b99c..8de0cfa90bc 100644 --- a/components/script_layout_interface/wrapper_traits.rs +++ b/components/script_layout_interface/wrapper_traits.rs @@ -13,6 +13,7 @@ use gfx_traits::{ByteIndex, FragmentType, combine_id_with_fragment_type}; use html5ever::{Namespace, LocalName}; use msg::constellation_msg::{BrowsingContextId, PipelineId}; use range::Range; +use servo_arc::Arc; use servo_url::ServoUrl; use std::fmt::Debug; use style::attr::AttrValue; @@ -24,7 +25,6 @@ use style::dom::OpaqueNode; use style::font_metrics::ServoMetricsProvider; use style::properties::{CascadeFlags, ComputedValues}; use style::selector_parser::{PseudoElement, PseudoElementCascadeType, SelectorImpl}; -use style::stylearc::Arc; use style::stylist::RuleInclusion; use webrender_api::ClipId; diff --git a/components/style/Cargo.toml b/components/style/Cargo.toml index 860c652cd02..0d349c8f66c 100644 --- a/components/style/Cargo.toml +++ b/components/style/Cargo.toml @@ -60,8 +60,8 @@ pdqsort = "0.1.0" precomputed-hash = "0.1" rayon = "0.8" selectors = { path = "../selectors" } -servo_arc = { path = "../servo_arc" } serde = {version = "1.0", optional = true, features = ["derive"]} +servo_arc = { path = "../servo_arc" } servo_atoms = {path = "../atoms", optional = true} servo_config = {path = "../config", optional = true} smallvec = "0.4" diff --git a/components/style/animation.rs b/components/style/animation.rs index 8d652d8e0e9..b9faf26f7ef 100644 --- a/components/style/animation.rs +++ b/components/style/animation.rs @@ -17,8 +17,8 @@ use properties::longhands::animation_direction::computed_value::single_value::T use properties::longhands::animation_iteration_count::single_value::computed_value::T as AnimationIterationCount; use properties::longhands::animation_play_state::computed_value::single_value::T as AnimationPlayState; use rule_tree::CascadeLevel; +use servo_arc::Arc; use std::sync::mpsc::Sender; -use stylearc::Arc; use stylesheets::keyframes_rule::{KeyframesStep, KeyframesStepValue}; use timer::Timer; use values::computed::Time; diff --git a/components/style/applicable_declarations.rs b/components/style/applicable_declarations.rs index 17cf13f7f4d..733418b4707 100644 --- a/components/style/applicable_declarations.rs +++ b/components/style/applicable_declarations.rs @@ -6,11 +6,11 @@ use properties::PropertyDeclarationBlock; use rule_tree::{CascadeLevel, StyleSource}; +use servo_arc::Arc; use shared_lock::Locked; use smallvec::SmallVec; use std::fmt::{Debug, self}; use std::mem; -use stylearc::Arc; /// List of applicable declarations. This is a transient structure that shuttles /// declarations between selector matching and inserting into the rule tree, and diff --git a/components/style/attr.rs b/components/style/attr.rs index a0d9b838446..9861c4360f9 100644 --- a/components/style/attr.rs +++ b/components/style/attr.rs @@ -13,6 +13,7 @@ use euclid::num::Zero; use num_traits::ToPrimitive; use properties::PropertyDeclarationBlock; use selectors::attr::AttrSelectorOperation; +use servo_arc::Arc; use servo_url::ServoUrl; use shared_lock::Locked; use std::ascii::AsciiExt; @@ -20,7 +21,6 @@ use std::str::FromStr; use str::{HTML_SPACE_CHARACTERS, read_exponent, read_fraction}; use str::{read_numbers, split_commas, split_html_space_chars}; use str::str_join; -use stylearc::Arc; use values::specified::Length; // Duplicated from script::dom::values. diff --git a/components/style/bloom.rs b/components/style/bloom.rs index d6d05c2ed20..a49f40e9bc3 100644 --- a/components/style/bloom.rs +++ b/components/style/bloom.rs @@ -11,8 +11,8 @@ use atomic_refcell::{AtomicRefMut, AtomicRefCell}; use dom::{SendElement, TElement}; use owning_ref::OwningHandle; use selectors::bloom::BloomFilter; +use servo_arc::Arc; use smallvec::SmallVec; -use stylearc::Arc; /// Bloom filters are large allocations, so we store them in thread-local storage /// such that they can be reused across style traversals. StyleBloom is responsible diff --git a/components/style/context.rs b/components/style/context.rs index 31915a38d19..befcd9d9e03 100644 --- a/components/style/context.rs +++ b/components/style/context.rs @@ -20,13 +20,13 @@ use properties::ComputedValues; use rule_tree::StrongRuleNode; use selector_parser::{EAGER_PSEUDO_COUNT, SnapshotMap}; use selectors::matching::ElementSelectorFlags; +use servo_arc::Arc; use shared_lock::StylesheetGuards; use sharing::StyleSharingCandidateCache; use std::fmt; use std::ops; #[cfg(feature = "servo")] use std::sync::Mutex; #[cfg(feature = "servo")] use std::sync::mpsc::Sender; -use stylearc::Arc; use stylist::Stylist; use thread_state; use time; diff --git a/components/style/custom_properties.rs b/components/style/custom_properties.rs index 0f22a0b075c..50b49107f25 100644 --- a/components/style/custom_properties.rs +++ b/components/style/custom_properties.rs @@ -11,12 +11,12 @@ use cssparser::{Delimiter, Parser, ParserInput, SourcePosition, Token, TokenSeri use parser::ParserContext; use properties::{CSSWideKeyword, DeclaredValue}; use selectors::parser::SelectorParseError; +use servo_arc::Arc; use std::ascii::AsciiExt; use std::borrow::Cow; use std::collections::{HashMap, hash_map, HashSet}; use std::fmt; use style_traits::{HasViewportPercentage, ToCss, StyleParseError, ParseError}; -use stylearc::Arc; /// A custom property name is just an `Atom`. /// diff --git a/components/style/data.rs b/components/style/data.rs index 9ddd20c0dce..0927edfc432 100644 --- a/components/style/data.rs +++ b/components/style/data.rs @@ -11,9 +11,9 @@ use properties::ComputedValues; use properties::longhands::display::computed_value as display; use rule_tree::StrongRuleNode; use selector_parser::{EAGER_PSEUDO_COUNT, PseudoElement, RestyleDamage}; +use servo_arc::Arc; use shared_lock::StylesheetGuards; use std::ops::{Deref, DerefMut}; -use stylearc::Arc; bitflags! { flags RestyleFlags: u8 { diff --git a/components/style/dom.rs b/components/style/dom.rs index abc733cb0b2..12eff9c7c12 100644 --- a/components/style/dom.rs +++ b/components/style/dom.rs @@ -23,6 +23,7 @@ use selector_parser::{AttrValue, ElementExt, PreExistingComputedValues}; use selector_parser::{PseudoClassStringArg, PseudoElement}; use selectors::matching::{ElementSelectorFlags, VisitedHandlingMode}; use selectors::sink::Push; +use servo_arc::{Arc, ArcBorrow}; use shared_lock::Locked; use smallvec::VecLike; use std::fmt; @@ -30,7 +31,6 @@ use std::fmt; use std::fmt::Debug; use std::hash::Hash; use std::ops::Deref; -use stylearc::{Arc, ArcBorrow}; use stylist::Stylist; use thread_state; use traversal::TraversalFlags; diff --git a/components/style/encoding_support.rs b/components/style/encoding_support.rs index 4f6365ffeae..6560342e942 100644 --- a/components/style/encoding_support.rs +++ b/components/style/encoding_support.rs @@ -11,9 +11,9 @@ use cssparser::{stylesheet_encoding, EncodingSupport}; use error_reporting::ParseErrorReporter; use media_queries::MediaList; use self::encoding::{EncodingRef, DecoderTrap}; +use servo_arc::Arc; use shared_lock::SharedRwLock; use std::str; -use stylearc::Arc; use stylesheets::{Stylesheet, StylesheetLoader, Origin, UrlExtraData}; struct RustEncoding; diff --git a/components/style/gecko/data.rs b/components/style/gecko/data.rs index c6a73714b26..08cb11a4fe3 100644 --- a/components/style/gecko/data.rs +++ b/components/style/gecko/data.rs @@ -17,8 +17,8 @@ use gecko_bindings::sugar::ownership::{HasArcFFI, HasBoxFFI, HasFFI, HasSimpleFF use invalidation::media_queries::{MediaListKey, ToMediaListKey}; use media_queries::{Device, MediaList}; use properties::ComputedValues; +use servo_arc::Arc; use shared_lock::{Locked, StylesheetGuards, SharedRwLockReadGuard}; -use stylearc::Arc; use stylesheet_set::StylesheetSet; use stylesheets::{Origin, StylesheetContents, StylesheetInDocument}; use stylist::{ExtraStyleData, Stylist}; diff --git a/components/style/gecko/restyle_damage.rs b/components/style/gecko/restyle_damage.rs index 471b95f0304..2af898a28aa 100644 --- a/components/style/gecko/restyle_damage.rs +++ b/components/style/gecko/restyle_damage.rs @@ -9,8 +9,8 @@ use gecko_bindings::structs; use gecko_bindings::structs::{nsChangeHint, nsStyleContext}; use matching::{StyleChange, StyleDifference}; use properties::ComputedValues; +use servo_arc::Arc; use std::ops::{BitAnd, BitOr, BitOrAssign, Not}; -use stylearc::Arc; /// The representation of Gecko's restyle damage is just a wrapper over /// `nsChangeHint`. diff --git a/components/style/gecko/url.rs b/components/style/gecko/url.rs index dca3f6f0db7..b206ad761e7 100644 --- a/components/style/gecko/url.rs +++ b/components/style/gecko/url.rs @@ -10,9 +10,9 @@ use gecko_bindings::structs::root::mozilla::css::ImageValue; use gecko_bindings::structs::root::nsStyleImageRequest; use gecko_bindings::sugar::refptr::RefPtr; use parser::ParserContext; +use servo_arc::Arc; use std::fmt; use style_traits::{ToCss, ParseError}; -use stylearc::Arc; /// A specified url() value for gecko. Gecko does not eagerly resolve SpecifiedUrls. #[derive(Clone, Debug, PartialEq)] diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index c6744249a44..9536ed6277a 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -79,6 +79,7 @@ use selectors::attr::{AttrSelectorOperation, AttrSelectorOperator, CaseSensitivi use selectors::matching::{ElementSelectorFlags, LocalMatchingContext, MatchingContext}; use selectors::matching::{RelevantLinkStatus, VisitedHandlingMode}; use selectors::sink::Push; +use servo_arc::{Arc, ArcBorrow, RawOffsetArc}; use shared_lock::Locked; use std::cell::RefCell; use std::collections::HashMap; @@ -88,7 +89,6 @@ use std::mem; use std::ops::DerefMut; use std::ptr; use string_cache::{Atom, Namespace, WeakAtom, WeakNamespace}; -use stylearc::{Arc, ArcBorrow, RawOffsetArc}; use stylesheets::UrlExtraData; use stylist::Stylist; diff --git a/components/style/gecko_bindings/sugar/ownership.rs b/components/style/gecko_bindings/sugar/ownership.rs index b4e0677bb9e..b0ac00368ea 100644 --- a/components/style/gecko_bindings/sugar/ownership.rs +++ b/components/style/gecko_bindings/sugar/ownership.rs @@ -4,11 +4,11 @@ //! Helpers for different FFI pointer kinds that Gecko's FFI layer uses. +use servo_arc::{Arc, RawOffsetArc}; use std::marker::PhantomData; use std::mem::{forget, transmute}; use std::ops::{Deref, DerefMut}; use std::ptr; -use stylearc::{Arc, RawOffsetArc}; /// Indicates that a given Servo type has a corresponding Gecko FFI type. pub unsafe trait HasFFI : Sized + 'static { diff --git a/components/style/gecko_bindings/sugar/refptr.rs b/components/style/gecko_bindings/sugar/refptr.rs index 048e12151ca..d27ef7205d4 100644 --- a/components/style/gecko_bindings/sugar/refptr.rs +++ b/components/style/gecko_bindings/sugar/refptr.rs @@ -6,10 +6,10 @@ use gecko_bindings::structs; use gecko_bindings::sugar::ownership::HasArcFFI; +use servo_arc::Arc; use std::{mem, ptr}; use std::marker::PhantomData; use std::ops::{Deref, DerefMut}; -use stylearc::Arc; /// Trait for all objects that have Addref() and Release /// methods and can be placed inside RefPtr<T> diff --git a/components/style/matching.rs b/components/style/matching.rs index 5b06c08b5b3..cc7d9415a1a 100644 --- a/components/style/matching.rs +++ b/components/style/matching.rs @@ -18,7 +18,7 @@ use properties::longhands::display::computed_value as display; use rule_tree::{CascadeLevel, StrongRuleNode}; use selector_parser::{PseudoElement, RestyleDamage}; use selectors::matching::ElementSelectorFlags; -use stylearc::{Arc, ArcBorrow}; +use servo_arc::{Arc, ArcBorrow}; /// Represents the result of comparing an element's old and new style. pub struct StyleDifference { diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index f42a83a6f01..055d33a62c9 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -58,9 +58,9 @@ use properties::{longhands, FontComputationData, Importance, LonghandId}; use properties::{PropertyDeclaration, PropertyDeclarationBlock, PropertyDeclarationId}; use rule_tree::StrongRuleNode; use selector_parser::PseudoElement; +use servo_arc::{Arc, RawOffsetArc}; use std::mem::{forget, uninitialized, transmute, zeroed}; use std::{cmp, ops, ptr}; -use stylearc::{Arc, RawOffsetArc}; use values::{Auto, CustomIdent, Either, KeyframesName}; use values::computed::ToComputedValue; use values::computed::effects::{BoxShadow, Filter, SimpleShadow}; diff --git a/components/style/properties/helpers.mako.rs b/components/style/properties/helpers.mako.rs index e59be799737..2c635b51947 100644 --- a/components/style/properties/helpers.mako.rs +++ b/components/style/properties/helpers.mako.rs @@ -298,7 +298,7 @@ #[allow(unused_imports)] use selectors::parser::SelectorParseError; #[allow(unused_imports)] - use stylearc::Arc; + use servo_arc::Arc; #[allow(unused_imports)] use style_traits::{ParseError, StyleParseError}; #[allow(unused_imports)] diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index 7fb32603173..2f6d3766ab9 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -10,10 +10,10 @@ <%namespace name="helpers" file="/helpers.mako.rs" /> +use servo_arc::{Arc, UniqueArc}; use std::borrow::Cow; use std::collections::HashSet; use std::{fmt, mem, ops}; -use stylearc::{Arc, UniqueArc}; use app_units::Au; #[cfg(feature = "servo")] use cssparser::RGBA; @@ -2352,13 +2352,13 @@ pub fn get_writing_mode(inheritedbox_style: &style_structs::InheritedBox) -> Wri } % if product == "gecko": - pub use ::stylearc::RawOffsetArc as BuilderArc; + pub use ::servo_arc::RawOffsetArc as BuilderArc; /// Clone an arc, returning a regular arc fn clone_arc<T: 'static>(x: &BuilderArc<T>) -> Arc<T> { Arc::from_raw_offset(x.clone()) } % else: - pub use ::stylearc::Arc as BuilderArc; + pub use ::servo_arc::Arc as BuilderArc; /// Clone an arc, returning a regular arc fn clone_arc<T: 'static>(x: &BuilderArc<T>) -> Arc<T> { x.clone() @@ -2653,7 +2653,7 @@ pub use self::lazy_static_module::INITIAL_SERVO_VALUES; #[allow(missing_docs)] mod lazy_static_module { use logical_geometry::WritingMode; - use stylearc::Arc; + use servo_arc::Arc; use super::{ComputedValues, ComputedValuesInner, longhands, style_structs, FontComputationData}; use super::computed_value_flags::ComputedValueFlags; diff --git a/components/style/rule_tree/mod.rs b/components/style/rule_tree/mod.rs index e9a76731f3b..0dc29232dac 100644 --- a/components/style/rule_tree/mod.rs +++ b/components/style/rule_tree/mod.rs @@ -10,13 +10,13 @@ use applicable_declarations::ApplicableDeclarationList; #[cfg(feature = "servo")] use heapsize::HeapSizeOf; use properties::{Importance, LonghandIdSet, PropertyDeclarationBlock}; +use servo_arc::{Arc, ArcBorrow, NonZeroPtrMut}; use shared_lock::{Locked, StylesheetGuards, SharedRwLockReadGuard}; use smallvec::SmallVec; use std::io::{self, Write}; use std::mem; use std::ptr; use std::sync::atomic::{AtomicPtr, AtomicUsize, Ordering}; -use stylearc::{Arc, ArcBorrow, NonZeroPtrMut}; use stylesheets::StyleRule; use thread_state; diff --git a/components/style/servo/url.rs b/components/style/servo/url.rs index 972eced90e7..ef257bacfe3 100644 --- a/components/style/servo/url.rs +++ b/components/style/servo/url.rs @@ -7,7 +7,7 @@ use parser::ParserContext; use servo_url::ServoUrl; use std::fmt; -// Note: We use std::sync::Arc rather than stylearc::Arc here because the +// Note: We use std::sync::Arc rather than servo_arc::Arc here because the // nonzero optimization is important in keeping the size of SpecifiedUrl below // the threshold. use std::sync::Arc; diff --git a/components/style/shared_lock.rs b/components/style/shared_lock.rs index 1a4ec7c9f20..d536673e3b2 100644 --- a/components/style/shared_lock.rs +++ b/components/style/shared_lock.rs @@ -8,11 +8,11 @@ use atomic_refcell::{AtomicRefCell, AtomicRef, AtomicRefMut}; #[cfg(feature = "servo")] use parking_lot::RwLock; +use servo_arc::Arc; use std::cell::UnsafeCell; use std::fmt; #[cfg(feature = "gecko")] use std::ptr; -use stylearc::Arc; /// A shared read/write lock that can protect multiple objects. /// diff --git a/components/style/sharing/checks.rs b/components/style/sharing/checks.rs index 8ff232d7f42..e7f8db5a54f 100644 --- a/components/style/sharing/checks.rs +++ b/components/style/sharing/checks.rs @@ -10,8 +10,8 @@ use Atom; use bloom::StyleBloom; use context::{SelectorFlagsMap, SharedStyleContext}; use dom::TElement; +use servo_arc::Arc; use sharing::{StyleSharingCandidate, StyleSharingTarget}; -use stylearc::Arc; /// Whether, given two elements, they have pointer-equal computed values. /// diff --git a/components/style/sharing/mod.rs b/components/style/sharing/mod.rs index daf81862c38..caa6f4afc86 100644 --- a/components/style/sharing/mod.rs +++ b/components/style/sharing/mod.rs @@ -77,11 +77,11 @@ use matching::MatchMethods; use owning_ref::OwningHandle; use properties::ComputedValues; use selectors::matching::{ElementSelectorFlags, VisitedHandlingMode}; +use servo_arc::Arc; use smallvec::SmallVec; use std::marker::PhantomData; use std::mem; use std::ops::Deref; -use stylearc::Arc; use stylist::Stylist; mod checks; diff --git a/components/style/style_resolver.rs b/components/style/style_resolver.rs index 0ef0d17c88c..02d80e344b0 100644 --- a/components/style/style_resolver.rs +++ b/components/style/style_resolver.rs @@ -17,7 +17,7 @@ use properties::{VISITED_DEPENDENT_ONLY, cascade}; use rule_tree::StrongRuleNode; use selector_parser::{PseudoElement, SelectorImpl}; use selectors::matching::{ElementSelectorFlags, MatchingContext, MatchingMode, VisitedHandlingMode}; -use stylearc::Arc; +use servo_arc::Arc; use stylist::RuleInclusion; /// A struct that takes care of resolving the style of a given element. diff --git a/components/style/stylesheets/document_rule.rs b/components/style/stylesheets/document_rule.rs index f8388eb5dda..a4390763416 100644 --- a/components/style/stylesheets/document_rule.rs +++ b/components/style/stylesheets/document_rule.rs @@ -9,10 +9,10 @@ use cssparser::{Parser, Token, SourceLocation, BasicParseError}; use media_queries::Device; use parser::{Parse, ParserContext}; +use servo_arc::Arc; use shared_lock::{DeepCloneParams, DeepCloneWithLock, Locked, SharedRwLock, SharedRwLockReadGuard, ToCssWithGuard}; use std::fmt; use style_traits::{ToCss, ParseError, StyleParseError}; -use stylearc::Arc; use stylesheets::CssRules; use values::specified::url::SpecifiedUrl; diff --git a/components/style/stylesheets/import_rule.rs b/components/style/stylesheets/import_rule.rs index 5f7812fd67e..8568012099a 100644 --- a/components/style/stylesheets/import_rule.rs +++ b/components/style/stylesheets/import_rule.rs @@ -42,7 +42,7 @@ impl DeepCloneWithLock for ImportSheet { /// A sheet that is held from an import rule. #[cfg(feature = "servo")] #[derive(Debug)] -pub struct ImportSheet(pub ::stylearc::Arc<::stylesheets::Stylesheet>); +pub struct ImportSheet(pub ::servo_arc::Arc<::stylesheets::Stylesheet>); impl StylesheetInDocument for ImportSheet { /// Get the media associated with this stylesheet. @@ -67,7 +67,7 @@ impl DeepCloneWithLock for ImportSheet { _guard: &SharedRwLockReadGuard, _params: &DeepCloneParams, ) -> Self { - use stylearc::Arc; + use servo_arc::Arc; ImportSheet(Arc::new((&*self.0).clone())) } diff --git a/components/style/stylesheets/keyframes_rule.rs b/components/style/stylesheets/keyframes_rule.rs index af12629c289..3ae1d8bf9ae 100644 --- a/components/style/stylesheets/keyframes_rule.rs +++ b/components/style/stylesheets/keyframes_rule.rs @@ -14,11 +14,11 @@ use properties::LonghandIdSet; use properties::animated_properties::AnimatableLonghand; use properties::longhands::transition_timing_function::single_value::SpecifiedValue as SpecifiedTimingFunction; use selectors::parser::SelectorParseError; +use servo_arc::Arc; use shared_lock::{DeepCloneParams, DeepCloneWithLock, SharedRwLock, SharedRwLockReadGuard, Locked, ToCssWithGuard}; use std::fmt; use style_traits::{PARSING_MODE_DEFAULT, ToCss, ParseError, StyleParseError}; use style_traits::PropertyDeclarationParseError; -use stylearc::Arc; use stylesheets::{CssRuleType, StylesheetContents}; use stylesheets::rule_parser::VendorPrefix; use values::KeyframesName; diff --git a/components/style/stylesheets/loader.rs b/components/style/stylesheets/loader.rs index 3e90ad8b6a1..072c64e45ee 100644 --- a/components/style/stylesheets/loader.rs +++ b/components/style/stylesheets/loader.rs @@ -8,8 +8,8 @@ use cssparser::SourceLocation; use media_queries::MediaList; use parser::ParserContext; +use servo_arc::Arc; use shared_lock::{Locked, SharedRwLock}; -use stylearc::Arc; use stylesheets::import_rule::ImportRule; use values::specified::url::SpecifiedUrl; diff --git a/components/style/stylesheets/media_rule.rs b/components/style/stylesheets/media_rule.rs index 600d6a920d4..4eb68999113 100644 --- a/components/style/stylesheets/media_rule.rs +++ b/components/style/stylesheets/media_rule.rs @@ -8,10 +8,10 @@ use cssparser::SourceLocation; use media_queries::MediaList; +use servo_arc::Arc; use shared_lock::{DeepCloneParams, DeepCloneWithLock, Locked, SharedRwLock, SharedRwLockReadGuard, ToCssWithGuard}; use std::fmt; use style_traits::ToCss; -use stylearc::Arc; use stylesheets::CssRules; /// An [`@media`][media] urle. diff --git a/components/style/stylesheets/mod.rs b/components/style/stylesheets/mod.rs index 33a4e2ab18c..c86c7c6f051 100644 --- a/components/style/stylesheets/mod.rs +++ b/components/style/stylesheets/mod.rs @@ -25,10 +25,10 @@ pub mod viewport_rule; use cssparser::{parse_one_rule, Parser, ParserInput}; use error_reporting::NullReporter; use parser::ParserContext; +use servo_arc::Arc; use shared_lock::{DeepCloneParams, DeepCloneWithLock, Locked, SharedRwLock, SharedRwLockReadGuard, ToCssWithGuard}; use std::fmt; use style_traits::PARSING_MODE_DEFAULT; -use stylearc::Arc; pub use self::counter_style_rule::CounterStyleRule; pub use self::document_rule::DocumentRule; diff --git a/components/style/stylesheets/page_rule.rs b/components/style/stylesheets/page_rule.rs index c29353b4e5b..f47c1316a50 100644 --- a/components/style/stylesheets/page_rule.rs +++ b/components/style/stylesheets/page_rule.rs @@ -8,10 +8,10 @@ use cssparser::SourceLocation; use properties::PropertyDeclarationBlock; +use servo_arc::Arc; use shared_lock::{DeepCloneParams, DeepCloneWithLock, Locked, SharedRwLock, SharedRwLockReadGuard, ToCssWithGuard}; use std::fmt; use style_traits::ToCss; -use stylearc::Arc; /// A [`@page`][page] rule. /// diff --git a/components/style/stylesheets/rule_list.rs b/components/style/stylesheets/rule_list.rs index 8764b8f89b6..82e78015400 100644 --- a/components/style/stylesheets/rule_list.rs +++ b/components/style/stylesheets/rule_list.rs @@ -4,8 +4,8 @@ //! A list of CSS rules. +use servo_arc::{Arc, RawOffsetArc}; use shared_lock::{DeepCloneParams, DeepCloneWithLock, Locked, SharedRwLock, SharedRwLockReadGuard}; -use stylearc::{Arc, RawOffsetArc}; use stylesheets::{CssRule, RulesMutateError}; use stylesheets::loader::StylesheetLoader; use stylesheets::memory::{MallocSizeOfFn, MallocSizeOfWithGuard}; diff --git a/components/style/stylesheets/rule_parser.rs b/components/style/stylesheets/rule_parser.rs index 3e9872b5a1c..a0923b41232 100644 --- a/components/style/stylesheets/rule_parser.rs +++ b/components/style/stylesheets/rule_parser.rs @@ -16,11 +16,11 @@ use properties::parse_property_declaration_list; use selector_parser::{SelectorImpl, SelectorParser}; use selectors::SelectorList; use selectors::parser::SelectorParseError; +use servo_arc::Arc; use shared_lock::{Locked, SharedRwLock}; use std::borrow::Cow; use str::starts_with_ignore_ascii_case; use style_traits::{StyleParseError, ParseError}; -use stylearc::Arc; use stylesheets::{CssRule, CssRules, CssRuleType, Origin, StylesheetLoader}; use stylesheets::{DocumentRule, KeyframesRule, MediaRule, NamespaceRule, PageRule}; use stylesheets::{StyleRule, SupportsRule, ViewportRule}; diff --git a/components/style/stylesheets/style_rule.rs b/components/style/stylesheets/style_rule.rs index 5f647321786..a66ad7eb5e8 100644 --- a/components/style/stylesheets/style_rule.rs +++ b/components/style/stylesheets/style_rule.rs @@ -8,10 +8,10 @@ use cssparser::SourceLocation; use properties::PropertyDeclarationBlock; use selector_parser::SelectorImpl; use selectors::SelectorList; +use servo_arc::Arc; use shared_lock::{DeepCloneParams, DeepCloneWithLock, Locked, SharedRwLock, SharedRwLockReadGuard, ToCssWithGuard}; use std::fmt; use style_traits::ToCss; -use stylearc::Arc; use stylesheets::{MallocSizeOf, MallocSizeOfFn, MallocSizeOfWithGuard}; /// A style rule, with selectors and declarations. diff --git a/components/style/stylesheets/stylesheet.rs b/components/style/stylesheets/stylesheet.rs index b2595faa8d3..1d0103e02ae 100644 --- a/components/style/stylesheets/stylesheet.rs +++ b/components/style/stylesheets/stylesheet.rs @@ -10,11 +10,11 @@ use fnv::FnvHashMap; use media_queries::{MediaList, Device}; use parking_lot::RwLock; use parser::{ParserContext, log_css_error}; +use servo_arc::Arc; use shared_lock::{DeepCloneParams, DeepCloneWithLock, Locked, SharedRwLock, SharedRwLockReadGuard}; use std::mem; use std::sync::atomic::{AtomicBool, Ordering}; use style_traits::PARSING_MODE_DEFAULT; -use stylearc::Arc; use stylesheets::{CssRule, CssRules, Origin, UrlExtraData}; use stylesheets::loader::StylesheetLoader; use stylesheets::memory::{MallocSizeOfFn, MallocSizeOfWithGuard}; diff --git a/components/style/stylesheets/supports_rule.rs b/components/style/stylesheets/supports_rule.rs index bfc497d6d90..ff856bacf3e 100644 --- a/components/style/stylesheets/supports_rule.rs +++ b/components/style/stylesheets/supports_rule.rs @@ -9,10 +9,10 @@ use cssparser::{Delimiter, parse_important, Parser, SourceLocation, Token}; use parser::ParserContext; use properties::{PropertyId, PropertyDeclaration, SourcePropertyDeclaration}; use selectors::parser::SelectorParseError; +use servo_arc::Arc; use shared_lock::{DeepCloneParams, DeepCloneWithLock, Locked, SharedRwLock, SharedRwLockReadGuard, ToCssWithGuard}; use std::fmt; use style_traits::{ToCss, ParseError, StyleParseError}; -use stylearc::Arc; use stylesheets::{CssRuleType, CssRules}; /// An [`@supports`][supports] rule. diff --git a/components/style/stylist.rs b/components/style/stylist.rs index 99c39930ea4..93a5def6497 100644 --- a/components/style/stylist.rs +++ b/components/style/stylist.rs @@ -31,13 +31,13 @@ use selectors::parser::{AncestorHashes, Combinator, Component, Selector}; use selectors::parser::{SelectorIter, SelectorMethods}; use selectors::sink::Push; use selectors::visitor::SelectorVisitor; +use servo_arc::{Arc, ArcBorrow}; use shared_lock::{Locked, SharedRwLockReadGuard, StylesheetGuards}; use smallvec::VecLike; use std::fmt::Debug; #[cfg(feature = "servo")] use std::marker::PhantomData; use style_traits::viewport::ViewportConstraints; -use stylearc::{Arc, ArcBorrow}; #[cfg(feature = "gecko")] use stylesheets::{CounterStyleRule, FontFaceRule}; use stylesheets::{CssRule, StyleRule}; diff --git a/ports/geckolib/Cargo.toml b/ports/geckolib/Cargo.toml index 01c4012a4ae..ba0680e999d 100644 --- a/ports/geckolib/Cargo.toml +++ b/ports/geckolib/Cargo.toml @@ -23,6 +23,7 @@ log = {version = "0.3.5", features = ["release_max_level_info"]} nsstring_vendor = {path = "../../components/style/gecko_bindings/nsstring_vendor"} parking_lot = "0.4" selectors = {path = "../../components/selectors"} +servo_arc = {path = "../../components/servo_arc"} style = {path = "../../components/style", features = ["gecko"]} style_traits = {path = "../../components/style_traits"} diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index b56d56c8e85..09cff20eca8 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -8,6 +8,7 @@ use cssparser::ToCss as ParserToCss; use env_logger::LogBuilder; use selectors::Element; use selectors::matching::{MatchingContext, MatchingMode, matches_selector}; +use servo_arc::{Arc, RawOffsetArc}; use std::env; use std::fmt::Write; use std::ptr; @@ -102,7 +103,6 @@ use style::sequential; use style::shared_lock::{SharedRwLockReadGuard, StylesheetGuards, ToCssWithGuard, Locked}; use style::string_cache::Atom; use style::style_adjuster::StyleAdjuster; -use style::stylearc::{Arc, RawOffsetArc}; use style::stylesheets::{CssRule, CssRules, CssRuleType, CssRulesHelpers, DocumentRule}; use style::stylesheets::{ImportRule, KeyframesRule, MallocSizeOfWithGuard, MediaRule}; use style::stylesheets::{NamespaceRule, Origin, PageRule, StyleRule, SupportsRule}; diff --git a/ports/geckolib/lib.rs b/ports/geckolib/lib.rs index 33df99ee119..37f33245656 100644 --- a/ports/geckolib/lib.rs +++ b/ports/geckolib/lib.rs @@ -10,6 +10,7 @@ extern crate env_logger; extern crate libc; #[macro_use] extern crate log; extern crate selectors; +extern crate servo_arc; #[macro_use] extern crate style; extern crate style_traits; diff --git a/ports/geckolib/stylesheet_loader.rs b/ports/geckolib/stylesheet_loader.rs index 57a0811c166..fde5ad35dc5 100644 --- a/ports/geckolib/stylesheet_loader.rs +++ b/ports/geckolib/stylesheet_loader.rs @@ -3,6 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use cssparser::SourceLocation; +use servo_arc::Arc; use style::gecko::data::GeckoStyleSheet; use style::gecko_bindings::bindings::Gecko_LoadStyleSheet; use style::gecko_bindings::structs::{Loader, ServoStyleSheet, LoaderReusableStyleSheets}; @@ -10,7 +11,6 @@ use style::gecko_bindings::sugar::ownership::FFIArcHelpers; use style::media_queries::MediaList; use style::parser::ParserContext; use style::shared_lock::{Locked, SharedRwLock}; -use style::stylearc::Arc; use style::stylesheets::{ImportRule, StylesheetLoader as StyleStylesheetLoader}; use style::stylesheets::import_rule::ImportSheet; use style::values::specified::url::SpecifiedUrl; diff --git a/tests/unit/style/Cargo.toml b/tests/unit/style/Cargo.toml index 15acba42a02..cae6d143554 100644 --- a/tests/unit/style/Cargo.toml +++ b/tests/unit/style/Cargo.toml @@ -22,6 +22,7 @@ parking_lot = "0.4" rayon = "0.8" rustc-serialize = "0.3" selectors = {path = "../../../components/selectors"} +servo_arc = {path = "../../../components/servo_arc"} servo_atoms = {path = "../../../components/atoms"} servo_config = {path = "../../../components/config"} servo_url = {path = "../../../components/url"} diff --git a/tests/unit/style/keyframes.rs b/tests/unit/style/keyframes.rs index b546b28ad53..1cb706edf40 100644 --- a/tests/unit/style/keyframes.rs +++ b/tests/unit/style/keyframes.rs @@ -2,10 +2,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use servo_arc::Arc; use style::properties::{PropertyDeclaration, PropertyDeclarationBlock, Importance}; use style::properties::animated_properties::AnimatableLonghand; use style::shared_lock::SharedRwLock; -use style::stylearc::Arc; use style::stylesheets::keyframes_rule::{Keyframe, KeyframesAnimation, KeyframePercentage, KeyframeSelector}; use style::stylesheets::keyframes_rule::{KeyframesStep, KeyframesStepValue}; use style::values::specified::{LengthOrPercentageOrAuto, NoCalcLength}; diff --git a/tests/unit/style/lib.rs b/tests/unit/style/lib.rs index c248e92d3d5..0647a59251f 100644 --- a/tests/unit/style/lib.rs +++ b/tests/unit/style/lib.rs @@ -14,6 +14,7 @@ extern crate parking_lot; extern crate rayon; extern crate rustc_serialize; extern crate selectors; +extern crate servo_arc; extern crate servo_atoms; extern crate servo_config; extern crate servo_url; diff --git a/tests/unit/style/media_queries.rs b/tests/unit/style/media_queries.rs index 3e091b8171e..dc24eed3594 100644 --- a/tests/unit/style/media_queries.rs +++ b/tests/unit/style/media_queries.rs @@ -4,6 +4,7 @@ use cssparser::{Parser, SourcePosition}; use euclid::TypedSize2D; +use servo_arc::Arc; use servo_url::ServoUrl; use std::borrow::ToOwned; use style::Atom; @@ -12,7 +13,6 @@ use style::error_reporting::{ParseErrorReporter, ContextualParseError}; use style::media_queries::*; use style::servo::media_queries::*; use style::shared_lock::SharedRwLock; -use style::stylearc::Arc; use style::stylesheets::{AllRules, Stylesheet, StylesheetInDocument, Origin, CssRule}; use style::values::specified; use style_traits::ToCss; diff --git a/tests/unit/style/rule_tree/bench.rs b/tests/unit/style/rule_tree/bench.rs index 661dc76b63e..598344a3236 100644 --- a/tests/unit/style/rule_tree/bench.rs +++ b/tests/unit/style/rule_tree/bench.rs @@ -4,6 +4,7 @@ use cssparser::{Parser, SourcePosition}; use rayon; +use servo_arc::Arc; use servo_url::ServoUrl; use style::context::QuirksMode; use style::error_reporting::{ParseErrorReporter, ContextualParseError}; @@ -11,7 +12,6 @@ use style::media_queries::MediaList; use style::properties::{longhands, Importance, PropertyDeclaration, PropertyDeclarationBlock}; use style::rule_tree::{CascadeLevel, RuleTree, StrongRuleNode, StyleSource}; use style::shared_lock::SharedRwLock; -use style::stylearc::Arc; use style::stylesheets::{Origin, Stylesheet, CssRule}; use test::{self, Bencher}; diff --git a/tests/unit/style/stylesheets.rs b/tests/unit/style/stylesheets.rs index 51205b86427..35c93eb1729 100644 --- a/tests/unit/style/stylesheets.rs +++ b/tests/unit/style/stylesheets.rs @@ -8,6 +8,7 @@ use media_queries::CSSErrorReporterTest; use parking_lot::RwLock; use selectors::attr::*; use selectors::parser::*; +use servo_arc::Arc; use servo_atoms::Atom; use servo_url::ServoUrl; use std::borrow::ToOwned; @@ -21,7 +22,6 @@ use style::properties::{CSSWideKeyword, DeclaredValueOwned, PropertyDeclaration, use style::properties::longhands; use style::properties::longhands::animation_play_state; use style::shared_lock::SharedRwLock; -use style::stylearc::Arc; use style::stylesheets::{Origin, Namespaces}; use style::stylesheets::{Stylesheet, StylesheetContents, NamespaceRule, CssRule, CssRules, StyleRule, KeyframesRule}; use style::stylesheets::keyframes_rule::{Keyframe, KeyframeSelector, KeyframePercentage}; diff --git a/tests/unit/style/stylist.rs b/tests/unit/style/stylist.rs index 13e9ae24f5c..b1cf2ef2508 100644 --- a/tests/unit/style/stylist.rs +++ b/tests/unit/style/stylist.rs @@ -7,6 +7,7 @@ use euclid::TypedSize2D; use html5ever::LocalName; use selectors::parser::{AncestorHashes, Selector}; use selectors::parser::LocalName as LocalNameSelector; +use servo_arc::Arc; use servo_atoms::Atom; use style::context::QuirksMode; use style::media_queries::{Device, MediaType}; @@ -16,7 +17,6 @@ use style::rule_tree::CascadeLevel; use style::selector_map::{self, SelectorMap}; use style::selector_parser::{SelectorImpl, SelectorParser}; use style::shared_lock::SharedRwLock; -use style::stylearc::Arc; use style::stylesheets::StyleRule; use style::stylist::{Stylist, Rule}; use style::stylist::needs_revalidation; diff --git a/tests/unit/style/viewport.rs b/tests/unit/style/viewport.rs index cb82ee6d65f..9f71e312925 100644 --- a/tests/unit/style/viewport.rs +++ b/tests/unit/style/viewport.rs @@ -5,13 +5,13 @@ use cssparser::{Parser, ParserInput}; use euclid::TypedSize2D; use media_queries::CSSErrorReporterTest; +use servo_arc::Arc; use servo_config::prefs::{PREFS, PrefValue}; use servo_url::ServoUrl; use style::context::QuirksMode; use style::media_queries::{Device, MediaList, MediaType}; use style::parser::{Parse, ParserContext}; use style::shared_lock::SharedRwLock; -use style::stylearc::Arc; use style::stylesheets::{CssRuleType, Stylesheet, StylesheetInDocument, Origin}; use style::stylesheets::viewport_rule::*; use style::values::specified::LengthOrPercentageOrAuto::{self, Auto}; |