diff options
Diffstat (limited to 'components/layout')
-rw-r--r-- | components/layout/Cargo.toml | 1 | ||||
-rw-r--r-- | components/layout/block.rs | 2 | ||||
-rw-r--r-- | components/layout/construct.rs | 8 | ||||
-rw-r--r-- | components/layout/flex.rs | 2 | ||||
-rw-r--r-- | components/layout/flow.rs | 6 | ||||
-rw-r--r-- | components/layout/fragment.rs | 14 | ||||
-rw-r--r-- | components/layout/generated_content.rs | 4 | ||||
-rw-r--r-- | components/layout/inline.rs | 8 | ||||
-rw-r--r-- | components/layout/lib.rs | 5 | ||||
-rw-r--r-- | components/layout/list_item.rs | 2 | ||||
-rw-r--r-- | components/layout/multicol.rs | 6 | ||||
-rw-r--r-- | components/layout/table.rs | 2 | ||||
-rw-r--r-- | components/layout/table_caption.rs | 2 | ||||
-rw-r--r-- | components/layout/table_cell.rs | 2 | ||||
-rw-r--r-- | components/layout/table_colgroup.rs | 2 | ||||
-rw-r--r-- | components/layout/table_row.rs | 2 | ||||
-rw-r--r-- | components/layout/table_rowgroup.rs | 2 | ||||
-rw-r--r-- | components/layout/table_wrapper.rs | 2 | ||||
-rw-r--r-- | components/layout/text.rs | 2 |
19 files changed, 38 insertions, 36 deletions
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) |