diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs index 747543dd7fc..828d4c443fd 100644 --- a/components/gfx/display_list/mod.rs +++ b/components/gfx/display_list/mod.rs @@ -41,7 +41,7 @@ use std::ops::{Deref, DerefMut}; use std::sync::Arc; use style::computed_values::{border_style, cursor, filter, image_rendering, mix_blend_mode}; use style::computed_values::{pointer_events}; -use style::properties::{ComputedValues, TComputedValues}; +use style::properties::{ServoComputedValues, TComputedValues}; use style_traits::cursor::Cursor; use text::TextRun; use text::glyph::CharIndex; @@ -927,7 +927,7 @@ impl DisplayItemMetadata { /// be `PointerCursor`, but for text display items it may be `TextCursor` or /// `VerticalTextCursor`. #[inline] - pub fn new(node: OpaqueNode, style: &ComputedValues, default_cursor: Cursor) + pub fn new(node: OpaqueNode, style: &ServoComputedValues, default_cursor: Cursor) -> DisplayItemMetadata { DisplayItemMetadata { node: node, @@ -1419,4 +1419,3 @@ impl WebRenderImageInfo { } } } - diff --git a/components/layout/block.rs b/components/layout/block.rs index b987313b21f..fec6b2185bf 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -57,7 +57,7 @@ use style::computed_values::{border_collapse, box_sizing, display, float, overfl use style::computed_values::{position, text_align, transform_style}; use style::context::StyleContext; use style::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize, WritingMode}; -use style::properties::{ComputedValues, TComputedValues}; +use style::properties::{ServoComputedValues, TComputedValues}; use style::values::computed::{LengthOrNone, LengthOrPercentageOrNone}; use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto}; use util::geometry::MAX_RECT; @@ -2033,7 +2033,7 @@ impl Flow for BlockFlow { self.fragment.restyle_damage.remove(REPAINT); } - fn repair_style(&mut self, new_style: &Arc) { + fn repair_style(&mut self, new_style: &Arc) { self.fragment.repair_style(new_style) } @@ -2955,4 +2955,3 @@ pub enum BlockStackingContextType { PseudoStackingContext, StackingContext, } - diff --git a/components/layout/construct.rs b/components/layout/construct.rs index c964501116c..050eb9d9857 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -45,7 +45,7 @@ use std::sync::atomic::Ordering; use style::computed_values::content::ContentItem; use style::computed_values::{caption_side, display, empty_cells, float, list_style_position}; use style::computed_values::{position}; -use style::properties::{self, ComputedValues, TComputedValues}; +use style::properties::{self, ServoComputedValues, TComputedValues}; use table::TableFlow; use table_caption::TableCaptionFlow; use table_cell::TableCellFlow; @@ -105,7 +105,7 @@ pub enum ConstructionItem { /// Inline fragments and associated {ib} splits that have not yet found flows. InlineFragments(InlineFragmentsConstructionResult), /// Potentially ignorable whitespace. - Whitespace(OpaqueNode, PseudoElementType<()>, Arc, RestyleDamage), + Whitespace(OpaqueNode, PseudoElementType<()>, Arc, RestyleDamage), /// TableColumn Fragment TableColumnFragment(Fragment), } @@ -702,7 +702,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode> fn create_fragments_for_node_text_content(&self, fragments: &mut IntermediateInlineFragments, node: &ConcreteThreadSafeLayoutNode, - style: &Arc) { + style: &Arc) { // Fast path: If there is no text content, return immediately. let text_content = node.text_content(); if text_content.is_empty() { @@ -1821,7 +1821,7 @@ pub fn strip_ignorable_whitespace_from_end(this: &mut LinkedList) { /// 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: &Arc) -> Option<(&'static str, &'static str)> { +fn bidi_control_chars(style: &Arc) -> Option<(&'static str, &'static str)> { use style::computed_values::direction::T::*; use style::computed_values::unicode_bidi::T::*; diff --git a/components/layout/context.rs b/components/layout/context.rs index 7b6fa3e4691..169c2f38082 100644 --- a/components/layout/context.rs +++ b/components/layout/context.rs @@ -26,14 +26,14 @@ use std::rc::Rc; use std::sync::{Arc, Mutex, RwLock}; use style::context::{LocalStyleContext, StyleContext}; use style::matching::{ApplicableDeclarationsCache, StyleSharingCandidateCache}; -use style::properties::ComputedValues; +use style::properties::ServoComputedValues; use style::selector_impl::ServoSelectorImpl; use style::servo::SharedStyleContext; use url::Url; use util::opts; struct LocalLayoutContext { - style_context: LocalStyleContext, + style_context: LocalStyleContext, font_context: RefCell, } @@ -108,12 +108,12 @@ pub struct LayoutContext<'a> { cached_local_layout_context: Rc, } -impl<'a> StyleContext<'a, ServoSelectorImpl, ComputedValues> for LayoutContext<'a> { +impl<'a> StyleContext<'a, ServoSelectorImpl, ServoComputedValues> for LayoutContext<'a> { fn shared_context(&self) -> &'a SharedStyleContext { &self.shared.style_context } - fn local_context(&self) -> &LocalStyleContext { + fn local_context(&self) -> &LocalStyleContext { &self.cached_local_layout_context.style_context } } @@ -234,4 +234,3 @@ impl<'a> LayoutContext<'a> { } } } - diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs index de6e707169c..797723528a7 100644 --- a/components/layout/display_list_builder.rs +++ b/components/layout/display_list_builder.rs @@ -51,7 +51,7 @@ use style::computed_values::{border_style, image_rendering, overflow_x, position use style::computed_values::{transform, transform_style, visibility}; use style::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize, WritingMode}; use style::properties::style_structs::Border; -use style::properties::{self, ComputedValues, TComputedValues}; +use style::properties::{self, ServoComputedValues, TComputedValues}; use style::values::RGBA; use style::values::computed; use style::values::computed::{LengthOrNone, LengthOrPercentage, LengthOrPercentageOrAuto, LinearGradient}; @@ -130,7 +130,7 @@ pub trait FragmentDisplayListBuilding { /// list if necessary. fn build_display_list_for_background_if_applicable(&self, state: &mut DisplayListBuildState, - style: &ComputedValues, + style: &ServoComputedValues, display_list_section: DisplayListSection, absolute_bounds: &Rect, clip: &ClippingRegion); @@ -138,7 +138,7 @@ pub trait FragmentDisplayListBuilding { /// Computes the background size for an image with the given background area according to the /// rules in CSS-BACKGROUNDS § 3.9. fn compute_background_image_size(&self, - style: &ComputedValues, + style: &ServoComputedValues, bounds: &Rect, image: &WebRenderImageInfo) -> Size2D; @@ -147,7 +147,7 @@ pub trait FragmentDisplayListBuilding { /// appropriate section of the display list. fn build_display_list_for_background_image(&self, state: &mut DisplayListBuildState, - style: &ComputedValues, + style: &ServoComputedValues, display_list_section: DisplayListSection, absolute_bounds: &Rect, clip: &ClippingRegion, @@ -161,14 +161,14 @@ pub trait FragmentDisplayListBuilding { absolute_bounds: &Rect, clip: &ClippingRegion, gradient: &LinearGradient, - style: &ComputedValues); + style: &ServoComputedValues); /// Adds the display items necessary to paint the borders of this fragment to a display list if /// necessary. fn build_display_list_for_borders_if_applicable( &self, state: &mut DisplayListBuildState, - style: &ComputedValues, + style: &ServoComputedValues, border_painting_mode: BorderPaintingMode, bounds: &Rect, display_list_section: DisplayListSection, @@ -178,7 +178,7 @@ pub trait FragmentDisplayListBuilding { /// if necessary. fn build_display_list_for_outline_if_applicable(&self, state: &mut DisplayListBuildState, - style: &ComputedValues, + style: &ServoComputedValues, bounds: &Rect, clip: &ClippingRegion); @@ -186,7 +186,7 @@ pub trait FragmentDisplayListBuilding { /// list if necessary. fn build_display_list_for_box_shadow_if_applicable(&self, state: &mut DisplayListBuildState, - style: &ComputedValues, + style: &ServoComputedValues, display_list_section: DisplayListSection, absolute_bounds: &Rect, clip: &ClippingRegion); @@ -194,7 +194,7 @@ pub trait FragmentDisplayListBuilding { /// Adds display items necessary to draw debug boxes around a scanned text fragment. fn build_debug_borders_around_text_fragments(&self, state: &mut DisplayListBuildState, - style: &ComputedValues, + style: &ServoComputedValues, stacking_relative_border_box: &Rect, stacking_relative_content_box: &Rect, text_fragment: &ScannedTextFragmentInfo, @@ -331,7 +331,7 @@ fn build_border_radius(abs_bounds: &Rect, border_style: &Border) -> BorderRa impl FragmentDisplayListBuilding for Fragment { fn build_display_list_for_background_if_applicable(&self, state: &mut DisplayListBuildState, - style: &ComputedValues, + style: &ServoComputedValues, display_list_section: DisplayListSection, absolute_bounds: &Rect, clip: &ClippingRegion) { @@ -406,7 +406,7 @@ impl FragmentDisplayListBuilding for Fragment { } fn compute_background_image_size(&self, - style: &ComputedValues, + style: &ServoComputedValues, bounds: &Rect, image: &WebRenderImageInfo) -> Size2D { @@ -460,7 +460,7 @@ impl FragmentDisplayListBuilding for Fragment { fn build_display_list_for_background_image(&self, state: &mut DisplayListBuildState, - style: &ComputedValues, + style: &ServoComputedValues, display_list_section: DisplayListSection, absolute_bounds: &Rect, clip: &ClippingRegion, @@ -581,7 +581,7 @@ impl FragmentDisplayListBuilding for Fragment { absolute_bounds: &Rect, clip: &ClippingRegion, gradient: &LinearGradient, - style: &ComputedValues) { + style: &ServoComputedValues) { let mut clip = clip.clone(); clip.intersect_rect(absolute_bounds); @@ -697,7 +697,7 @@ impl FragmentDisplayListBuilding for Fragment { fn build_display_list_for_box_shadow_if_applicable(&self, state: &mut DisplayListBuildState, - style: &ComputedValues, + style: &ServoComputedValues, display_list_section: DisplayListSection, absolute_bounds: &Rect, clip: &ClippingRegion) { @@ -736,7 +736,7 @@ impl FragmentDisplayListBuilding for Fragment { fn build_display_list_for_borders_if_applicable( &self, state: &mut DisplayListBuildState, - style: &ComputedValues, + style: &ServoComputedValues, border_painting_mode: BorderPaintingMode, bounds: &Rect, display_list_section: DisplayListSection, @@ -799,7 +799,7 @@ impl FragmentDisplayListBuilding for Fragment { fn build_display_list_for_outline_if_applicable(&self, state: &mut DisplayListBuildState, - style: &ComputedValues, + style: &ServoComputedValues, bounds: &Rect, clip: &ClippingRegion) { let width = style.get_outline().outline_width; @@ -838,7 +838,7 @@ impl FragmentDisplayListBuilding for Fragment { fn build_debug_borders_around_text_fragments(&self, state: &mut DisplayListBuildState, - style: &ComputedValues, + style: &ServoComputedValues, stacking_relative_border_box: &Rect, stacking_relative_content_box: &Rect, text_fragment: &ScannedTextFragmentInfo, diff --git a/components/layout/flex.rs b/components/layout/flex.rs index 29df5d4f43f..3e8f004f822 100644 --- a/components/layout/flex.rs +++ b/components/layout/flex.rs @@ -28,7 +28,7 @@ use std::sync::Arc; use style::computed_values::flex_direction; use style::logical_geometry::LogicalSize; use style::properties::style_structs; -use style::properties::{ComputedValues, TComputedValues}; +use style::properties::{ServoComputedValues, TComputedValues}; use style::values::computed::LengthOrPercentageOrAuto; // A mode describes which logical axis a flex axis is parallel with. @@ -414,7 +414,7 @@ impl Flow for FlexFlow { self.block_flow.collect_stacking_contexts(parent_id, contexts) } - fn repair_style(&mut self, new_style: &Arc) { + fn repair_style(&mut self, new_style: &Arc) { self.block_flow.repair_style(new_style) } diff --git a/components/layout/flow.rs b/components/layout/flow.rs index 591db584233..73f7bc85152 100644 --- a/components/layout/flow.rs +++ b/components/layout/flow.rs @@ -50,7 +50,7 @@ use std::{fmt, mem, raw}; use style::computed_values::{clear, display, empty_cells, float, position, overflow_x, text_align}; use style::dom::TRestyleDamage; use style::logical_geometry::{LogicalRect, LogicalSize, WritingMode}; -use style::properties::{self, ComputedValues, TComputedValues}; +use style::properties::{self, ServoComputedValues, TComputedValues}; use style::values::computed::LengthOrPercentageOrAuto; use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, TableFlow}; use table_caption::TableCaptionFlow; @@ -410,7 +410,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: &Arc); + fn repair_style(&mut self, new_style: &Arc); /// Print any extra children (such as fragments) contained in this Flow /// for debugging purposes. Any items inserted into the tree will become @@ -542,7 +542,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: &Arc); + fn repair_style_and_bubble_inline_sizes(self, style: &Arc); } pub trait MutableOwnedFlowUtils { @@ -1051,7 +1051,7 @@ pub enum ForceNonfloatedFlag { impl BaseFlow { #[inline] - pub fn new(style: Option<&ComputedValues>, + pub fn new(style: Option<&ServoComputedValues>, writing_mode: WritingMode, force_nonfloated: ForceNonfloatedFlag) -> BaseFlow { @@ -1422,7 +1422,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: &Arc) { + fn repair_style_and_bubble_inline_sizes(self, style: &Arc) { self.repair_style(style); self.bubble_inline_sizes(); } @@ -1579,4 +1579,3 @@ impl OpaqueFlow { } } } - diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index ba7ff2f714e..02f3f272ceb 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -41,7 +41,7 @@ use style::computed_values::{overflow_x, position, text_decoration, transform_st use style::computed_values::{white_space, word_break, z_index}; use style::dom::TRestyleDamage; use style::logical_geometry::{LogicalMargin, LogicalRect, LogicalSize, WritingMode}; -use style::properties::{ComputedValues, TComputedValues}; +use style::properties::{ServoComputedValues, TComputedValues}; use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto}; use style::values::computed::{LengthOrPercentageOrNone}; use text; @@ -83,7 +83,7 @@ pub struct Fragment { pub node: OpaqueNode, /// The CSS style of this fragment. - pub style: Arc, + pub style: Arc, /// The position of this fragment relative to its owning flow. The size includes padding and /// border, but not margin. @@ -485,7 +485,7 @@ impl ReplacedImageFragmentInfo { } pub fn calculate_replaced_inline_size(&mut self, - style: &ComputedValues, + style: &ServoComputedValues, noncontent_inline_size: Au, container_inline_size: Au, fragment_inline_size: Au, @@ -540,7 +540,7 @@ impl ReplacedImageFragmentInfo { } pub fn calculate_replaced_block_size(&mut self, - style: &ComputedValues, + style: &ServoComputedValues, noncontent_block_size: Au, containing_block_block_size: Option, fragment_inline_size: Au, @@ -596,7 +596,7 @@ impl IframeFragmentInfo { } #[inline] - pub fn calculate_replaced_inline_size(&self, style: &ComputedValues, containing_size: Au) + pub fn calculate_replaced_inline_size(&self, style: &ServoComputedValues, containing_size: Au) -> Au { // Calculate the replaced inline size (or default) as per CSS 2.1 § 10.3.2 IframeFragmentInfo::calculate_replaced_size(style.content_inline_size(), @@ -607,7 +607,7 @@ impl IframeFragmentInfo { } #[inline] - pub fn calculate_replaced_block_size(&self, style: &ComputedValues, containing_size: Option) + pub fn calculate_replaced_block_size(&self, style: &ServoComputedValues, containing_size: Option) -> Au { // Calculate the replaced block size (or default) as per CSS 2.1 § 10.3.2 IframeFragmentInfo::calculate_replaced_size(style.content_block_size(), @@ -814,7 +814,7 @@ impl Fragment { /// Constructs a new `Fragment` instance from an opaque node. pub fn from_opaque_node_and_style(node: OpaqueNode, pseudo: PseudoElementType<()>, - style: Arc, + style: Arc, mut restyle_damage: RestyleDamage, specific: SpecificFragmentInfo) -> Fragment { @@ -1229,7 +1229,7 @@ impl Fragment { // Return offset from original position because of `position: relative`. pub fn relative_position(&self, containing_block_size: &LogicalSize) -> LogicalSize { - fn from_style(style: &ComputedValues, container_size: &LogicalSize) + fn from_style(style: &ServoComputedValues, container_size: &LogicalSize) -> LogicalSize { let offsets = style.logical_position(); let offset_i = if offsets.inline_start != LengthOrPercentageOrAuto::Auto { @@ -1282,7 +1282,7 @@ impl Fragment { } #[inline(always)] - pub fn style(&self) -> &ComputedValues { + pub fn style(&self) -> &ServoComputedValues { &*self.style } @@ -2087,7 +2087,7 @@ impl Fragment { } } - pub fn repair_style(&mut self, new_style: &Arc) { + pub fn repair_style(&mut self, new_style: &Arc) { self.style = (*new_style).clone() } @@ -2576,9 +2576,9 @@ pub struct InlineStyleIterator<'a> { } impl<'a> Iterator for InlineStyleIterator<'a> { - type Item = &'a ComputedValues; + type Item = &'a ServoComputedValues; - fn next(&mut self) -> Option<&'a ComputedValues> { + fn next(&mut self) -> Option<&'a ServoComputedValues> { if !self.primary_style_yielded { self.primary_style_yielded = true; return Some(&*self.fragment.style) @@ -2675,4 +2675,3 @@ pub struct SpeculatedInlineContentEdgeOffsets { pub start: Au, pub end: Au, } - diff --git a/components/layout/generated_content.rs b/components/layout/generated_content.rs index 7af9c4349d2..d4be74f9a4d 100644 --- a/components/layout/generated_content.rs +++ b/components/layout/generated_content.rs @@ -20,7 +20,7 @@ use std::sync::Arc; use style::computed_values::content::ContentItem; use style::computed_values::{display, list_style_type}; use style::dom::TRestyleDamage; -use style::properties::{ComputedValues, TComputedValues}; +use style::properties::{ServoComputedValues, TComputedValues}; use text::TextRunScanner; use wrapper::PseudoElementType; @@ -297,7 +297,7 @@ impl<'a,'b> ResolveGeneratedContentFragmentMutator<'a,'b> { self.incremented = true } - fn quote(&self, style: &ComputedValues, close: bool) -> String { + fn quote(&self, style: &ServoComputedValues, close: bool) -> String { let quotes = &style.get_list().quotes; if quotes.0.is_empty() { return String::new() @@ -367,7 +367,7 @@ impl Counter { layout_context: &LayoutContext, node: OpaqueNode, pseudo: PseudoElementType<()>, - style: Arc, + style: Arc, list_style_type: list_style_type::T, mode: RenderingMode) -> Option { @@ -430,7 +430,7 @@ struct CounterValue { fn render_text(layout_context: &LayoutContext, node: OpaqueNode, pseudo: PseudoElementType<()>, - style: Arc, + style: Arc, string: String) -> Option { let mut fragments = LinkedList::new(); diff --git a/components/layout/incremental.rs b/components/layout/incremental.rs index 8daf3cdd14f..d28cdae548c 100644 --- a/components/layout/incremental.rs +++ b/components/layout/incremental.rs @@ -7,7 +7,7 @@ use std::fmt; use std::sync::Arc; use style::computed_values::float; use style::dom::TRestyleDamage; -use style::properties::{ComputedValues, TComputedValues}; +use style::properties::{ServoComputedValues, TComputedValues}; bitflags! { #[doc = "Individual layout actions that may be necessary after restyling."] @@ -53,8 +53,9 @@ bitflags! { } impl TRestyleDamage for RestyleDamage { - type ConcreteComputedValues = ComputedValues; - fn compute(old: Option<&Arc>, new: &ComputedValues) -> RestyleDamage { compute_damage(old, new) } + type ConcreteComputedValues = ServoComputedValues; + fn compute(old: Option<&Arc>, new: &ServoComputedValues) -> + RestyleDamage { compute_damage(old, new) } /// Returns a bitmask that represents a flow that needs to be rebuilt and reflowed. /// @@ -153,8 +154,8 @@ macro_rules! add_if_not_equal( }) ); -pub fn compute_damage(old: Option<&Arc>, new: &ComputedValues) -> RestyleDamage { - let old: &ComputedValues = match old { +pub fn compute_damage(old: Option<&Arc>, new: &ServoComputedValues) -> RestyleDamage { + let old: &ServoComputedValues = match old { None => return RestyleDamage::rebuild_and_reflow(), Some(cv) => &**cv, }; @@ -162,7 +163,7 @@ pub fn compute_damage(old: Option<&Arc>, new: &ComputedValues) - let mut damage = RestyleDamage::empty(); // This should check every CSS property, as enumerated in the fields of - // http://doc.servo.org/style/properties/struct.ComputedValues.html + // http://doc.servo.org/style/properties/struct.ServoComputedValues.html // FIXME: Test somehow that every property is included. diff --git a/components/layout/inline.rs b/components/layout/inline.rs index cd2a822f317..dfaadf4defc 100644 --- a/components/layout/inline.rs +++ b/components/layout/inline.rs @@ -30,7 +30,7 @@ use std::{fmt, isize, mem}; use style::computed_values::{display, overflow_x, position, text_align, text_justify}; use style::computed_values::{text_overflow, vertical_align, white_space}; use style::logical_geometry::{LogicalRect, LogicalSize, WritingMode}; -use style::properties::{ComputedValues, TComputedValues}; +use style::properties::{ServoComputedValues, TComputedValues}; use style::values::computed::LengthOrPercentage; use text; use unicode_bidi; @@ -1176,7 +1176,7 @@ impl InlineFlow { /// `style` is the style of the block. pub fn compute_minimum_ascent_and_descent(&self, font_context: &mut FontContext, - style: &ComputedValues) + style: &ServoComputedValues) -> (Au, Au) { // As a special case, if this flow contains only hypothetical fragments, then the entire // flow is hypothetical and takes up no space. See CSS 2.1 § 10.3.7. @@ -1761,7 +1761,7 @@ impl Flow for InlineFlow { } } - fn repair_style(&mut self, _: &Arc) {} + fn repair_style(&mut self, _: &Arc) {} fn compute_overflow(&self) -> Overflow { let mut overflow = Overflow::new(); @@ -1850,7 +1850,7 @@ impl fmt::Debug for InlineFlow { #[derive(Clone)] pub struct InlineFragmentNodeInfo { pub address: OpaqueNode, - pub style: Arc, + pub style: Arc, pub pseudo: PseudoElementType<()>, pub flags: InlineFragmentNodeFlags, } diff --git a/components/layout/list_item.rs b/components/layout/list_item.rs index e64faa96758..f89b53b2461 100644 --- a/components/layout/list_item.rs +++ b/components/layout/list_item.rs @@ -23,7 +23,7 @@ use inline::InlineMetrics; use std::sync::Arc; use style::computed_values::{list_style_type, position}; use style::logical_geometry::LogicalSize; -use style::properties::{ComputedValues, TComputedValues}; +use style::properties::{ServoComputedValues, TComputedValues}; use text; /// A block with the CSS `display` property equal to `list-item`. @@ -152,7 +152,7 @@ impl Flow for ListItemFlow { self.block_flow.collect_stacking_contexts(parent_id, contexts) } - fn repair_style(&mut self, new_style: &Arc) { + fn repair_style(&mut self, new_style: &Arc) { self.block_flow.repair_style(new_style) } diff --git a/components/layout/model.rs b/components/layout/model.rs index baacc756454..516358fe798 100644 --- a/components/layout/model.rs +++ b/components/layout/model.rs @@ -13,7 +13,7 @@ use std::cmp::{max, min}; use std::fmt; use style::computed_values::transform::ComputedMatrix; use style::logical_geometry::LogicalMargin; -use style::properties::{ComputedValues, TComputedValues}; +use style::properties::{ServoComputedValues, TComputedValues}; use style::values::computed::{BorderRadiusSize, LengthOrPercentageOrAuto}; use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrNone}; @@ -440,7 +440,7 @@ pub fn specified_border_radius(radius: BorderRadiusSize, containing_length: Au) } #[inline] -pub fn padding_from_style(style: &ComputedValues, containing_block_inline_size: Au) +pub fn padding_from_style(style: &ServoComputedValues, containing_block_inline_size: Au) -> LogicalMargin { let padding_style = style.get_padding(); LogicalMargin::from_physical(style.writing_mode, SideOffsets2D::new( @@ -455,7 +455,7 @@ pub fn padding_from_style(style: &ComputedValues, containing_block_inline_size: /// /// This is used when calculating intrinsic inline sizes. #[inline] -pub fn specified_margin_from_style(style: &ComputedValues) -> LogicalMargin { +pub fn specified_margin_from_style(style: &ServoComputedValues) -> LogicalMargin { let margin_style = style.get_margin(); LogicalMargin::from_physical(style.writing_mode, SideOffsets2D::new( MaybeAuto::from_style(margin_style.margin_top, Au(0)).specified_or_zero(), diff --git a/components/layout/multicol.rs b/components/layout/multicol.rs index b7e89fecf6c..7ee8fca9a3f 100644 --- a/components/layout/multicol.rs +++ b/components/layout/multicol.rs @@ -21,7 +21,7 @@ use std::fmt; use std::sync::Arc; use style::context::StyleContext; use style::logical_geometry::LogicalSize; -use style::properties::{ComputedValues, TComputedValues}; +use style::properties::{ServoComputedValues, TComputedValues}; use style::values::computed::{LengthOrPercentageOrAuto, LengthOrPercentageOrNone}; use util::print_tree::PrintTree; @@ -191,7 +191,7 @@ impl Flow for MulticolFlow { self.block_flow.collect_stacking_contexts(parent_id, contexts) } - fn repair_style(&mut self, new_style: &Arc) { + fn repair_style(&mut self, new_style: &Arc) { self.block_flow.repair_style(new_style) } @@ -276,7 +276,7 @@ impl Flow for MulticolColumnFlow { self.block_flow.collect_stacking_contexts(parent_id, contexts) } - fn repair_style(&mut self, new_style: &Arc) { + fn repair_style(&mut self, new_style: &Arc) { self.block_flow.repair_style(new_style) } diff --git a/components/layout/table.rs b/components/layout/table.rs index 7efea169a32..1e68542c150 100644 --- a/components/layout/table.rs +++ b/components/layout/table.rs @@ -25,7 +25,7 @@ use std::fmt; use std::sync::Arc; use style::computed_values::{border_collapse, border_spacing, table_layout}; use style::logical_geometry::LogicalSize; -use style::properties::{ComputedValues, TComputedValues}; +use style::properties::{ServoComputedValues, TComputedValues}; use style::values::CSSFloat; use style::values::computed::LengthOrPercentageOrAuto; use table_row::{TableRowFlow}; @@ -468,7 +468,7 @@ impl Flow for TableFlow { self.block_flow.collect_stacking_contexts(parent_id, contexts) } - fn repair_style(&mut self, new_style: &Arc) { + fn repair_style(&mut self, new_style: &Arc) { self.block_flow.repair_style(new_style) } diff --git a/components/layout/table_caption.rs b/components/layout/table_caption.rs index 20ca8d8a8dc..f0159e2bab7 100644 --- a/components/layout/table_caption.rs +++ b/components/layout/table_caption.rs @@ -17,7 +17,7 @@ use gfx::display_list::{StackingContext, StackingContextId}; use std::fmt; use std::sync::Arc; use style::logical_geometry::LogicalSize; -use style::properties::{ComputedValues, TComputedValues}; +use style::properties::{ServoComputedValues, TComputedValues}; use util::print_tree::PrintTree; /// A table formatting context. @@ -88,7 +88,7 @@ impl Flow for TableCaptionFlow { self.block_flow.collect_stacking_contexts(parent_id, contexts) } - fn repair_style(&mut self, new_style: &Arc) { + fn repair_style(&mut self, new_style: &Arc) { self.block_flow.repair_style(new_style) } diff --git a/components/layout/table_cell.rs b/components/layout/table_cell.rs index 508d201f6fd..4230fc99e00 100644 --- a/components/layout/table_cell.rs +++ b/components/layout/table_cell.rs @@ -21,7 +21,7 @@ use std::fmt; use std::sync::Arc; use style::computed_values::{border_collapse, border_top_style}; use style::logical_geometry::{LogicalMargin, LogicalRect, LogicalSize, WritingMode}; -use style::properties::{ComputedValues, TComputedValues}; +use style::properties::{ServoComputedValues, TComputedValues}; use table::InternalTable; use table_row::{CollapsedBorder, CollapsedBorderProvenance}; use util::print_tree::PrintTree; @@ -198,7 +198,7 @@ impl Flow for TableCellFlow { self.block_flow.collect_stacking_contexts(parent_id, contexts) } - fn repair_style(&mut self, new_style: &Arc) { + fn repair_style(&mut self, new_style: &Arc) { self.block_flow.repair_style(new_style) } diff --git a/components/layout/table_colgroup.rs b/components/layout/table_colgroup.rs index 762e3526cf6..04ccadffada 100644 --- a/components/layout/table_colgroup.rs +++ b/components/layout/table_colgroup.rs @@ -18,7 +18,7 @@ use std::cmp::max; use std::fmt; use std::sync::Arc; use style::logical_geometry::LogicalSize; -use style::properties::{ComputedValues, TComputedValues}; +use style::properties::{ServoComputedValues, TComputedValues}; use style::values::computed::LengthOrPercentageOrAuto; /// A table formatting context. @@ -101,7 +101,7 @@ impl Flow for TableColGroupFlow { parent_id } - fn repair_style(&mut self, _: &Arc) {} + fn repair_style(&mut self, _: &Arc) {} fn compute_overflow(&self) -> Overflow { Overflow::new() diff --git a/components/layout/table_row.rs b/components/layout/table_row.rs index 64a2e71beed..6694fd5775c 100644 --- a/components/layout/table_row.rs +++ b/components/layout/table_row.rs @@ -25,7 +25,7 @@ use std::iter::{Enumerate, IntoIterator, Peekable}; use std::sync::Arc; use style::computed_values::{border_collapse, border_spacing, border_top_style}; use style::logical_geometry::{LogicalSize, PhysicalSide, WritingMode}; -use style::properties::{ComputedValues, TComputedValues}; +use style::properties::{ServoComputedValues, TComputedValues}; use style::values::computed::LengthOrPercentageOrAuto; use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable, VecExt}; use table_cell::{CollapsedBordersForCell, TableCellFlow}; @@ -440,7 +440,7 @@ impl Flow for TableRowFlow { self.block_flow.collect_stacking_contexts(parent_id, contexts) } - fn repair_style(&mut self, new_style: &Arc) { + fn repair_style(&mut self, new_style: &Arc) { self.block_flow.repair_style(new_style) } @@ -576,7 +576,7 @@ impl CollapsedBorder { /// Creates a collapsed border from the block-start border described in the given CSS style /// object. - fn top(css_style: &ComputedValues, provenance: CollapsedBorderProvenance) + fn top(css_style: &ServoComputedValues, provenance: CollapsedBorderProvenance) -> CollapsedBorder { CollapsedBorder { style: css_style.get_border().border_top_style, @@ -588,7 +588,7 @@ impl CollapsedBorder { /// Creates a collapsed border style from the right border described in the given CSS style /// object. - fn right(css_style: &ComputedValues, provenance: CollapsedBorderProvenance) + fn right(css_style: &ServoComputedValues, provenance: CollapsedBorderProvenance) -> CollapsedBorder { CollapsedBorder { style: css_style.get_border().border_right_style, @@ -600,7 +600,7 @@ impl CollapsedBorder { /// Creates a collapsed border style from the bottom border described in the given CSS style /// object. - fn bottom(css_style: &ComputedValues, provenance: CollapsedBorderProvenance) + fn bottom(css_style: &ServoComputedValues, provenance: CollapsedBorderProvenance) -> CollapsedBorder { CollapsedBorder { style: css_style.get_border().border_bottom_style, @@ -612,7 +612,7 @@ impl CollapsedBorder { /// Creates a collapsed border style from the left border described in the given CSS style /// object. - fn left(css_style: &ComputedValues, provenance: CollapsedBorderProvenance) + fn left(css_style: &ServoComputedValues, provenance: CollapsedBorderProvenance) -> CollapsedBorder { CollapsedBorder { style: css_style.get_border().border_left_style, @@ -624,7 +624,7 @@ impl CollapsedBorder { /// Creates a collapsed border style from the given physical side. fn from_side(side: PhysicalSide, - css_style: &ComputedValues, + css_style: &ServoComputedValues, provenance: CollapsedBorderProvenance) -> CollapsedBorder { match side { @@ -637,7 +637,7 @@ impl CollapsedBorder { /// Creates a collapsed border style from the inline-start border described in the given CSS /// style object. - pub fn inline_start(css_style: &ComputedValues, provenance: CollapsedBorderProvenance) + pub fn inline_start(css_style: &ServoComputedValues, provenance: CollapsedBorderProvenance) -> CollapsedBorder { CollapsedBorder::from_side(css_style.writing_mode.inline_start_physical_side(), css_style, @@ -646,7 +646,7 @@ impl CollapsedBorder { /// Creates a collapsed border style from the inline-start border described in the given CSS /// style object. - pub fn inline_end(css_style: &ComputedValues, provenance: CollapsedBorderProvenance) + pub fn inline_end(css_style: &ServoComputedValues, provenance: CollapsedBorderProvenance) -> CollapsedBorder { CollapsedBorder::from_side(css_style.writing_mode.inline_end_physical_side(), css_style, @@ -655,7 +655,7 @@ impl CollapsedBorder { /// Creates a collapsed border style from the block-start border described in the given CSS /// style object. - pub fn block_start(css_style: &ComputedValues, provenance: CollapsedBorderProvenance) + pub fn block_start(css_style: &ServoComputedValues, provenance: CollapsedBorderProvenance) -> CollapsedBorder { CollapsedBorder::from_side(css_style.writing_mode.block_start_physical_side(), css_style, @@ -664,7 +664,7 @@ impl CollapsedBorder { /// Creates a collapsed border style from the block-end border described in the given CSS style /// object. - pub fn block_end(css_style: &ComputedValues, provenance: CollapsedBorderProvenance) + pub fn block_end(css_style: &ServoComputedValues, provenance: CollapsedBorderProvenance) -> CollapsedBorder { CollapsedBorder::from_side(css_style.writing_mode.block_end_physical_side(), css_style, diff --git a/components/layout/table_rowgroup.rs b/components/layout/table_rowgroup.rs index a43d6f6ebbc..887049f3083 100644 --- a/components/layout/table_rowgroup.rs +++ b/components/layout/table_rowgroup.rs @@ -21,7 +21,7 @@ use std::iter::{IntoIterator, Iterator, Peekable}; use std::sync::Arc; use style::computed_values::{border_collapse, border_spacing}; use style::logical_geometry::{LogicalSize, WritingMode}; -use style::properties::{ComputedValues, TComputedValues}; +use style::properties::{ServoComputedValues, TComputedValues}; use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable, TableLikeFlow}; use table_row; use util::print_tree::PrintTree; @@ -217,7 +217,7 @@ impl Flow for TableRowGroupFlow { self.block_flow.collect_stacking_contexts(parent_id, contexts) } - fn repair_style(&mut self, new_style: &Arc) { + fn repair_style(&mut self, new_style: &Arc) { self.block_flow.repair_style(new_style) } diff --git a/components/layout/table_wrapper.rs b/components/layout/table_wrapper.rs index cdb88ccb428..70b9a9e4e50 100644 --- a/components/layout/table_wrapper.rs +++ b/components/layout/table_wrapper.rs @@ -30,7 +30,7 @@ use std::ops::Add; use std::sync::Arc; use style::computed_values::{border_collapse, table_layout}; use style::logical_geometry::LogicalSize; -use style::properties::{ComputedValues, TComputedValues}; +use style::properties::{ServoComputedValues, TComputedValues}; use style::values::CSSFloat; use style::values::computed::LengthOrPercentageOrAuto; use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize}; @@ -450,7 +450,7 @@ impl Flow for TableWrapperFlow { self.block_flow.collect_stacking_contexts(parent_id, contexts) } - fn repair_style(&mut self, new_style: &Arc) { + fn repair_style(&mut self, new_style: &Arc) { self.block_flow.repair_style(new_style) } diff --git a/components/layout/text.rs b/components/layout/text.rs index 14b0d138113..db9b8f13376 100644 --- a/components/layout/text.rs +++ b/components/layout/text.rs @@ -25,7 +25,7 @@ use style::computed_values::{line_height, text_orientation, text_rendering, text use style::computed_values::{white_space}; use style::logical_geometry::{LogicalSize, WritingMode}; use style::properties::style_structs::Font as FontStyle; -use style::properties::{ComputedValues, TComputedValues}; +use style::properties::{ServoComputedValues, TComputedValues}; use unicode_bidi::{is_rtl, process_text}; use unicode_script::{get_script, Script}; use util::linked_list::split_off_head; @@ -414,7 +414,7 @@ pub fn font_metrics_for_style(font_context: &mut FontContext, font_style: Arc Au { +pub fn line_height_from_style(style: &ServoComputedValues, metrics: &FontMetrics) -> Au { let font_size = style.get_font().font_size; match style.get_inheritedbox().line_height { line_height::T::Normal => metrics.line_gap, diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs index eb0176ddacd..abf74805a80 100644 --- a/components/layout/wrapper.rs +++ b/components/layout/wrapper.rs @@ -67,8 +67,8 @@ use style::computed_values::content::ContentItem; use style::computed_values::{content, display}; use style::dom::{TDocument, TElement, TNode, UnsafeNode}; use style::element_state::*; -use style::properties::{ComputedValues, TComputedValues}; use style::properties::{PropertyDeclaration, PropertyDeclarationBlock}; +use style::properties::{ServoComputedValues, TComputedValues}; use style::restyle_hints::ElementSnapshot; use style::selector_impl::{NonTSPseudoClass, PseudoElement, ServoSelectorImpl}; use style::servo::PrivateStyleData; @@ -132,7 +132,7 @@ impl<'ln> ServoLayoutNode<'ln> { } impl<'ln> TNode for ServoLayoutNode<'ln> { - type ConcreteComputedValues = ComputedValues; + type ConcreteComputedValues = ServoComputedValues; type ConcreteElement = ServoLayoutElement<'ln>; type ConcreteDocument = ServoLayoutDocument<'ln>; type ConcreteRestyleDamage = RestyleDamage; @@ -751,7 +751,7 @@ pub trait ThreadSafeLayoutNode : Clone + Copy + Sized + PartialEq { /// /// Unlike the version on TNode, this handles pseudo-elements. #[inline] - fn style(&self) -> Ref> { + fn style(&self) -> Ref> { Ref::map(self.borrow_layout_data().unwrap(), |data| { let style = match self.get_pseudo_element_type() { PseudoElementType::Before(_) => data.style_data.per_pseudo.get(&PseudoElement::Before), diff --git a/components/style/animation.rs b/components/style/animation.rs index e7663093cd5..42fb90e0561 100644 --- a/components/style/animation.rs +++ b/components/style/animation.rs @@ -25,7 +25,7 @@ use properties::longhands::vertical_align::computed_value::T as VerticalAlign; use properties::longhands::visibility::computed_value::T as Visibility; use properties::longhands::z_index::computed_value::T as ZIndex; use properties::style_struct_traits::TAnimation; -use properties::{ComputedValues, TComputedValues}; +use properties::{ServoComputedValues, TComputedValues}; use std::cmp::Ordering; use std::iter::repeat; use std::sync::mpsc::Sender; @@ -69,8 +69,8 @@ impl PropertyAnimation { /// Any number of animations may be returned, from zero (if the property did not animate) to /// one (for a single transition property) to arbitrarily many (for `all`). pub fn from_transition(transition_index: usize, - old_style: &ComputedValues, - new_style: &mut ComputedValues) + old_style: &ServoComputedValues, + new_style: &mut ServoComputedValues) -> Vec { let mut result = Vec::new(); let transition_property = @@ -102,8 +102,8 @@ impl PropertyAnimation { fn from_transition_property(transition_property: TransitionProperty, transition_index: usize, - old_style: &ComputedValues, - new_style: &mut ComputedValues) + old_style: &ServoComputedValues, + new_style: &mut ServoComputedValues) -> Option { let animation_style = new_style.get_animation(); macro_rules! match_transition { @@ -197,7 +197,7 @@ impl PropertyAnimation { } } - pub fn update(&self, style: &mut ComputedValues, time: f64) { + pub fn update(&self, style: &mut ServoComputedValues, time: f64) { let progress = match self.timing_function { TransitionTimingFunction::CubicBezier(p1, p2) => { // See `WebCore::AnimationBase::solveEpsilon(double)` in WebKit. diff --git a/components/style/properties.mako.rs b/components/style/properties.mako.rs index 7c0189f599e..732989c17c1 100644 --- a/components/style/properties.mako.rs +++ b/components/style/properties.mako.rs @@ -139,7 +139,7 @@ pub mod longhands { use error_reporting::ParseErrorReporter; use properties::longhands; use properties::property_bit_field::PropertyBitField; - use properties::{ComputedValues, PropertyDeclaration, TComputedValues}; + use properties::{ServoComputedValues, PropertyDeclaration, TComputedValues}; use properties::style_struct_traits::T${THIS_STYLE_STRUCT.name}; use properties::style_structs; use std::collections::HashMap; @@ -6240,8 +6240,8 @@ pub trait TComputedValues : Clone + Send + Sync + 'static { // yet - panics for non-Servo implementations. // // Used only for animations. Don't use it in other places. - fn as_servo<'a>(&'a self) -> &'a ComputedValues; - fn as_servo_mut<'a>(&'a mut self) -> &'a mut ComputedValues; + fn as_servo<'a>(&'a self) -> &'a ServoComputedValues; + fn as_servo_mut<'a>(&'a mut self) -> &'a mut ServoComputedValues; fn new(custom_properties: Option>, shareable: bool, @@ -6270,7 +6270,7 @@ pub trait TComputedValues : Clone + Send + Sync + 'static { } #[derive(Clone, HeapSizeOf)] -pub struct ComputedValues { +pub struct ServoComputedValues { % for style_struct in STYLE_STRUCTS: ${style_struct.ident}: Arc, % endfor @@ -6280,13 +6280,13 @@ pub struct ComputedValues { pub root_font_size: Au, } -impl TComputedValues for ComputedValues { +impl TComputedValues for ServoComputedValues { % for style_struct in STYLE_STRUCTS: type Concrete${style_struct.name} = style_structs::${style_struct.name}; % endfor - fn as_servo<'a>(&'a self) -> &'a ComputedValues { self } - fn as_servo_mut<'a>(&'a mut self) -> &'a mut ComputedValues { self } + fn as_servo<'a>(&'a self) -> &'a ServoComputedValues { self } + fn as_servo_mut<'a>(&'a mut self) -> &'a mut ServoComputedValues { self } fn new(custom_properties: Option>, shareable: bool, @@ -6296,7 +6296,7 @@ impl TComputedValues for ComputedValues { ${style_struct.ident}: Arc, % endfor ) -> Self { - ComputedValues { + ServoComputedValues { custom_properties: custom_properties, shareable: shareable, writing_mode: writing_mode, @@ -6345,7 +6345,7 @@ impl TComputedValues for ComputedValues { } } -impl ComputedValues { +impl ServoComputedValues { /// Resolves the currentColor keyword. /// Any color value form computed values (except for the 'color' property itself) /// should go through this method. @@ -6565,7 +6565,7 @@ pub fn get_writing_mode(inheritedbox_styl /// The initial values for all style structs as defined by the specification. lazy_static! { - pub static ref INITIAL_SERVO_VALUES: ComputedValues = ComputedValues { + pub static ref INITIAL_SERVO_VALUES: ServoComputedValues = ServoComputedValues { % for style_struct in STYLE_STRUCTS: ${style_struct.ident}: Arc::new(style_structs::${style_struct.name} { % for longhand in style_struct.longhands: @@ -6702,8 +6702,8 @@ pub type CascadePropertyFn = // This is a thread-local rather than a lazy static to avoid atomic operations when cascading // properties. -thread_local!(static CASCADE_PROPERTY: Vec>> = { - let mut result: Vec>> = Vec::new(); +thread_local!(static CASCADE_PROPERTY: Vec>> = { + let mut result: Vec>> = Vec::new(); % for style_struct in STYLE_STRUCTS: % for property in style_struct.longhands: let discriminant; @@ -6743,8 +6743,8 @@ pub fn cascade( viewport_size: Size2D, applicable_declarations: &[DeclarationBlock>], shareable: bool, - parent_style: Option< &C >, - cached_style: Option< &C >, + parent_style: Option<<&C>, + cached_style: Option<<&C>, mut error_reporter: Box) -> (C, bool) { use properties::style_struct_traits::{TBorder, TBox, TColor, TFont, TOutline}; @@ -6942,7 +6942,7 @@ pub fn cascade( /// /// FIXME(#5625, pcwalton): It would probably be cleaner and faster to do this in the cascade. #[inline] -pub fn modify_style_for_replaced_content(style: &mut Arc) { +pub fn modify_style_for_replaced_content(style: &mut Arc) { // Reset `position` to handle cases like `
foo bar baz
`. if style.box_.display != longhands::display::computed_value::T::inline { let mut style = Arc::make_mut(style); @@ -6978,10 +6978,10 @@ pub fn modify_style_for_replaced_content(style: &mut Arc) { /// Specifically, this function sets border widths to zero on the sides for which the fragment is /// not outermost. #[inline] -pub fn modify_border_style_for_inline_sides(style: &mut Arc, +pub fn modify_border_style_for_inline_sides(style: &mut Arc, is_first_fragment_of_element: bool, is_last_fragment_of_element: bool) { - fn modify_side(style: &mut Arc, side: PhysicalSide) { + fn modify_side(style: &mut Arc, side: PhysicalSide) { let mut style = Arc::make_mut(style); let border = Arc::make_mut(&mut style.border); match side { @@ -7018,7 +7018,7 @@ pub fn modify_border_style_for_inline_sides(style: &mut Arc, /// Adjusts the display and position properties as appropriate for an anonymous table object. #[inline] pub fn modify_style_for_anonymous_table_object( - style: &mut Arc, + style: &mut Arc, new_display_value: longhands::display::computed_value::T) { let mut style = Arc::make_mut(style); let box_style = Arc::make_mut(&mut style.box_); @@ -7028,7 +7028,7 @@ pub fn modify_style_for_anonymous_table_object( /// Adjusts the `position` property as necessary for the outer fragment wrapper of an inline-block. #[inline] -pub fn modify_style_for_outer_inline_block_fragment(style: &mut Arc) { +pub fn modify_style_for_outer_inline_block_fragment(style: &mut Arc) { let mut style = Arc::make_mut(style); let box_style = Arc::make_mut(&mut style.box_); box_style.position = longhands::position::computed_value::T::static_ @@ -7039,7 +7039,7 @@ pub fn modify_style_for_outer_inline_block_fragment(style: &mut Arc) { +pub fn modify_style_for_text(style: &mut Arc) { if style.box_.position == longhands::position::computed_value::T::relative { // We leave the `position` property set to `relative` so that we'll still establish a // containing block if needed. But we reset all position offsets to `auto`. @@ -7074,7 +7074,7 @@ pub fn modify_style_for_text(style: &mut Arc) { /// /// Margins apply to the `input` element itself, so including them in the text will cause them to /// be double-counted. -pub fn modify_style_for_input_text(style: &mut Arc) { +pub fn modify_style_for_input_text(style: &mut Arc) { let mut style = Arc::make_mut(style); let margin_style = Arc::make_mut(&mut style.margin); margin_style.margin_top = computed::LengthOrPercentageOrAuto::Length(Au(0)); @@ -7089,7 +7089,7 @@ pub fn modify_style_for_input_text(style: &mut Arc) { /// Adjusts the `clip` property so that an inline absolute hypothetical fragment doesn't clip its /// children. -pub fn modify_style_for_inline_absolute_hypothetical_fragment(style: &mut Arc) { +pub fn modify_style_for_inline_absolute_hypothetical_fragment(style: &mut Arc) { if style.get_effects().clip.0.is_some() { let mut style = Arc::make_mut(style); let effects_style = Arc::make_mut(&mut style.effects); diff --git a/components/style/servo.rs b/components/style/servo.rs index 10867d4eaf8..ec7044ad4a5 100644 --- a/components/style/servo.rs +++ b/components/style/servo.rs @@ -3,14 +3,14 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use context; use data; -use properties::ComputedValues; +use properties::ServoComputedValues; use selector_impl::ServoSelectorImpl; use selector_matching; use stylesheets; /// Concrete types for servo Style implementation pub type Stylesheet = stylesheets::Stylesheet; -pub type PrivateStyleData = data::PrivateStyleData; +pub type PrivateStyleData = data::PrivateStyleData; pub type Stylist = selector_matching::Stylist; pub type StylistWrapper = context::StylistWrapper; pub type SharedStyleContext = context::SharedStyleContext; diff --git a/components/style/viewport.rs b/components/style/viewport.rs index f2da78088e4..d0201fc57e2 100644 --- a/components/style/viewport.rs +++ b/components/style/viewport.rs @@ -8,7 +8,7 @@ use cssparser::{AtRuleParser, DeclarationListParser, DeclarationParser, Parser, use euclid::scale_factor::ScaleFactor; use euclid::size::{Size2D, TypedSize2D}; use parser::{ParserContext, log_css_error}; -use properties::{ComputedValues, TComputedValues}; +use properties::{ServoComputedValues, TComputedValues}; use std::ascii::AsciiExt; use std::collections::hash_map::{Entry, HashMap}; use std::fmt; @@ -594,8 +594,8 @@ impl MaybeNew for ViewportConstraints { let context = Context { is_root_element: false, viewport_size: initial_viewport, - inherited_style: ComputedValues::initial_values(), - style: ComputedValues::initial_values().clone(), + inherited_style: ServoComputedValues::initial_values(), + style: ServoComputedValues::initial_values().clone(), }; // DEVICE-ADAPT § 9.3 Resolving 'extend-to-zoom' diff --git a/ports/geckolib/properties.mako.rs b/ports/geckolib/properties.mako.rs index 4d2010dcecd..8d7a8441069 100644 --- a/ports/geckolib/properties.mako.rs +++ b/ports/geckolib/properties.mako.rs @@ -6,7 +6,7 @@ use app_units::Au; use std::sync::Arc; use style::custom_properties::ComputedValuesMap; use style::logical_geometry::WritingMode; -use style::properties::{CascadePropertyFn, ComputedValues, TComputedValues}; +use style::properties::{CascadePropertyFn, ServoComputedValues, TComputedValues}; use style::properties::longhands; use style::properties::style_struct_traits::*; @@ -28,8 +28,8 @@ impl TComputedValues for GeckoComputedValues { % endfor // These will go away, and we will never implement them. - fn as_servo<'a>(&'a self) -> &'a ComputedValues { unimplemented!() } - fn as_servo_mut<'a>(&'a mut self) -> &'a mut ComputedValues { unimplemented!() } + fn as_servo<'a>(&'a self) -> &'a ServoComputedValues { unimplemented!() } + fn as_servo_mut<'a>(&'a mut self) -> &'a mut ServoComputedValues { unimplemented!() } fn new(custom_properties: Option>, shareable: bool,