mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
Remove unneeded clones and add some comments.
This commit is contained in:
parent
26cf00ef4e
commit
71758643dc
4 changed files with 10 additions and 3 deletions
|
@ -419,7 +419,7 @@ impl<'a> FlowConstructor<'a> {
|
||||||
// between block elements, and retained when between inline elements.
|
// between block elements, and retained when between inline elements.
|
||||||
let fragment_info = UnscannedTextFragment(UnscannedTextFragmentInfo::from_text(" ".to_string()));
|
let fragment_info = UnscannedTextFragment(UnscannedTextFragmentInfo::from_text(" ".to_string()));
|
||||||
let mut fragment = Fragment::from_opaque_node_and_style(whitespace_node,
|
let mut fragment = Fragment::from_opaque_node_and_style(whitespace_node,
|
||||||
whitespace_style.clone(),
|
whitespace_style,
|
||||||
fragment_info);
|
fragment_info);
|
||||||
inline_fragment_accumulator.fragments.push(&mut fragment);
|
inline_fragment_accumulator.fragments.push(&mut fragment);
|
||||||
}
|
}
|
||||||
|
@ -583,7 +583,7 @@ impl<'a> FlowConstructor<'a> {
|
||||||
// Instantiate the whitespace fragment.
|
// Instantiate the whitespace fragment.
|
||||||
let fragment_info = UnscannedTextFragment(UnscannedTextFragmentInfo::from_text(" ".to_string()));
|
let fragment_info = UnscannedTextFragment(UnscannedTextFragmentInfo::from_text(" ".to_string()));
|
||||||
let mut fragment = Fragment::from_opaque_node_and_style(whitespace_node,
|
let mut fragment = Fragment::from_opaque_node_and_style(whitespace_node,
|
||||||
whitespace_style.clone(),
|
whitespace_style,
|
||||||
fragment_info);
|
fragment_info);
|
||||||
fragment_accumulator.fragments.push(&mut fragment)
|
fragment_accumulator.fragments.push(&mut fragment)
|
||||||
}
|
}
|
||||||
|
|
|
@ -619,6 +619,10 @@ impl<'ln> MatchMethods for LayoutNode<'ln> {
|
||||||
&Some(ref mut layout_data) => {
|
&Some(ref mut layout_data) => {
|
||||||
match self.type_id() {
|
match self.type_id() {
|
||||||
Some(TextNodeTypeId) => {
|
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();
|
let cloned_parent_style = parent_style.unwrap().clone();
|
||||||
layout_data.shared_data.style = Some(cloned_parent_style);
|
layout_data.shared_data.style = Some(cloned_parent_style);
|
||||||
}
|
}
|
||||||
|
|
|
@ -917,6 +917,9 @@ impl InlineFlow {
|
||||||
let mut block_size_above_baseline = inline_metrics.block_size_above_baseline;
|
let mut block_size_above_baseline = inline_metrics.block_size_above_baseline;
|
||||||
let mut depth_below_baseline = inline_metrics.depth_below_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() {
|
for frag in self.fragments.fragments.iter() {
|
||||||
match frag.inline_context {
|
match frag.inline_context {
|
||||||
Some(ref inline_context) => {
|
Some(ref inline_context) => {
|
||||||
|
|
|
@ -106,7 +106,7 @@ fragment=top != ../html/acid2.html acid2_ref.html
|
||||||
# Should be != with expected failure:
|
# Should be != with expected failure:
|
||||||
# FIXME: use the real test when pixel-snapping for scrolling is fixed.
|
# FIXME: use the real test when pixel-snapping for scrolling is fixed.
|
||||||
#fragment=top == ../html/acid2.html acid2_ref_broken.html
|
#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_background_a.html inline_background_ref.html
|
||||||
== inline_element_border_a.html inline_element_border_ref.html
|
== inline_element_border_a.html inline_element_border_ref.html
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue