diff --git a/components/layout/construct.rs b/components/layout/construct.rs index 7dd4da8ada4b..089209551ac9 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -51,7 +51,7 @@ use style::computed_values::content::ContentItem; use style::computed_values::position; use style::context::SharedStyleContext; use style::logical_geometry::Direction; -use style::properties::{self, ServoComputedValues}; +use style::properties::ServoComputedValues; use style::selector_parser::{PseudoElement, RestyleDamage}; use style::servo::restyle_damage::{BUBBLE_ISIZES, RECONSTRUCT_FLOW}; use style::values::Either; @@ -178,7 +178,7 @@ impl InlineBlockSplit { predecessors: mem::replace( fragment_accumulator, InlineFragmentsAccumulator::from_inline_node( - node, style_context)).to_intermediate_inline_fragments(), + node, style_context)).to_intermediate_inline_fragments(style_context), flow: flow, }; @@ -273,7 +273,8 @@ impl InlineFragmentsAccumulator { self.fragments.absolute_descendants.push_descendants(fragments.absolute_descendants); } - fn to_intermediate_inline_fragments(self) -> IntermediateInlineFragments { + fn to_intermediate_inline_fragments(self, context: &SharedStyleContext) + -> IntermediateInlineFragments { let InlineFragmentsAccumulator { mut fragments, enclosing_node, @@ -299,9 +300,9 @@ impl InlineFragmentsAccumulator { if let Some((start, end)) = bidi_control_chars { fragments.fragments.push_front( - control_chars_to_fragment(&enclosing_node, start, restyle_damage)); + control_chars_to_fragment(&enclosing_node, context, start, restyle_damage)); fragments.fragments.push_back( - control_chars_to_fragment(&enclosing_node, end, restyle_damage)); + control_chars_to_fragment(&enclosing_node, context, end, restyle_damage)); } } fragments @@ -340,7 +341,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode> } /// Builds the fragment for the given block or subclass thereof. - fn build_fragment_for_block(&mut self, node: &ConcreteThreadSafeLayoutNode) -> Fragment { + fn build_fragment_for_block(&self, node: &ConcreteThreadSafeLayoutNode) -> Fragment { let specific_fragment_info = match node.type_id() { Some(LayoutNodeType::Element(LayoutElementType::HTMLIFrameElement)) => { SpecificFragmentInfo::Iframe(IframeFragmentInfo::new(node)) @@ -399,7 +400,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode> absolute_descendants: &mut AbsoluteDescendants, legalizer: &mut Legalizer, node: &ConcreteThreadSafeLayoutNode) { - let mut fragments = fragment_accumulator.to_intermediate_inline_fragments(); + let mut fragments = fragment_accumulator.to_intermediate_inline_fragments(self.style_context()); if fragments.is_empty() { return }; @@ -546,14 +547,12 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode> ConstructionResult::ConstructionItem(ConstructionItem::Whitespace( whitespace_node, whitespace_pseudo, - mut whitespace_style, + whitespace_style, whitespace_damage)) => { // Add whitespace results. They will be stripped out later on when // between block elements, and retained when between inline elements. let fragment_info = SpecificFragmentInfo::UnscannedText( box UnscannedTextFragmentInfo::new(" ".to_owned(), None)); - properties::modify_style_for_replaced_content(&mut whitespace_style); - properties::modify_style_for_text(&mut whitespace_style); let fragment = Fragment::from_opaque_node_and_style(whitespace_node, whitespace_pseudo, whitespace_style, @@ -644,7 +643,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode> /// `