diff --git a/components/layout/construct.rs b/components/layout/construct.rs index 6478bc64d21..3d023c009f2 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -419,7 +419,7 @@ impl<'a> FlowConstructor<'a> { // between block elements, and retained when between inline elements. let fragment_info = UnscannedTextFragment(UnscannedTextFragmentInfo::from_text(" ".to_string())); let mut fragment = Fragment::from_opaque_node_and_style(whitespace_node, - whitespace_style.clone(), + whitespace_style, fragment_info); inline_fragment_accumulator.fragments.push(&mut fragment); } @@ -583,7 +583,7 @@ impl<'a> FlowConstructor<'a> { // Instantiate the whitespace fragment. let fragment_info = UnscannedTextFragment(UnscannedTextFragmentInfo::from_text(" ".to_string())); let mut fragment = Fragment::from_opaque_node_and_style(whitespace_node, - whitespace_style.clone(), + whitespace_style, fragment_info); fragment_accumulator.fragments.push(&mut fragment) } diff --git a/components/layout/css/matching.rs b/components/layout/css/matching.rs index 90526ef0e8f..564e5f6569f 100644 --- a/components/layout/css/matching.rs +++ b/components/layout/css/matching.rs @@ -619,6 +619,10 @@ impl<'ln> MatchMethods for LayoutNode<'ln> { &Some(ref mut layout_data) => { match self.type_id() { Some(TextNodeTypeId) => { + // Text nodes get a copy of the parent style. This ensures + // that during fragment construction any non-inherited + // CSS properties (such as vertical-align) are correctly + // set on the fragment(s). let cloned_parent_style = parent_style.unwrap().clone(); layout_data.shared_data.style = Some(cloned_parent_style); } diff --git a/components/layout/inline.rs b/components/layout/inline.rs index dd473d8edda..d67bbe5e0d6 100644 --- a/components/layout/inline.rs +++ b/components/layout/inline.rs @@ -917,6 +917,9 @@ impl InlineFlow { let mut block_size_above_baseline = inline_metrics.block_size_above_baseline; let mut depth_below_baseline = inline_metrics.depth_below_baseline; + // CSS section 10.8 + // line-height of any inline element specifies the minimal height of line + // boxes within the element. for frag in self.fragments.fragments.iter() { match frag.inline_context { Some(ref inline_context) => { diff --git a/tests/ref/basic.list b/tests/ref/basic.list index 923c474a49a..3ad68958f37 100644 --- a/tests/ref/basic.list +++ b/tests/ref/basic.list @@ -106,7 +106,7 @@ fragment=top != ../html/acid2.html acid2_ref.html # Should be != with expected failure: # FIXME: use the real test when pixel-snapping for scrolling is fixed. #fragment=top == ../html/acid2.html acid2_ref_broken.html -== acid2_noscroll.html acid2_ref_broken.html +flaky_linux == acid2_noscroll.html acid2_ref_broken.html != inline_background_a.html inline_background_ref.html == inline_element_border_a.html inline_element_border_ref.html