mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Review nits
This commit is contained in:
parent
607df04849
commit
6763e7e4ae
3 changed files with 7 additions and 9 deletions
|
@ -189,14 +189,13 @@ impl BlockContainer {
|
||||||
contains_floats: builder.contains_floats,
|
contains_floats: builder.contains_floats,
|
||||||
outer_content_sizes_of_children: ContentSizes::zero(),
|
outer_content_sizes_of_children: ContentSizes::zero(),
|
||||||
};
|
};
|
||||||
let request_childrens_outer_content_sizes = request_content_sizes;
|
|
||||||
let iter = builder.block_level_boxes.into_par_iter();
|
let iter = builder.block_level_boxes.into_par_iter();
|
||||||
let iter = iter.mapfold_reduce_into(
|
let iter = iter.mapfold_reduce_into(
|
||||||
&mut target,
|
&mut target,
|
||||||
|target, (intermediate, box_slot): (Intermediate<_>, BoxSlot<'_>)| {
|
|target, (intermediate, box_slot): (Intermediate<_>, BoxSlot<'_>)| {
|
||||||
let (block_level_box, box_contains_floats) = intermediate.finish(
|
let (block_level_box, box_contains_floats) = intermediate.finish(
|
||||||
context,
|
context,
|
||||||
if request_childrens_outer_content_sizes {
|
if request_content_sizes {
|
||||||
Some(&mut target.outer_content_sizes_of_children)
|
Some(&mut target.outer_content_sizes_of_children)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
|
|
@ -406,9 +406,10 @@ fn layout_atomic<'box_tree>(
|
||||||
.margin()
|
.margin()
|
||||||
.percentages_relative_to(cbis)
|
.percentages_relative_to(cbis)
|
||||||
.auto_is(Length::zero);
|
.auto_is(Length::zero);
|
||||||
ifc.inline_position += padding.inline_start + border.inline_start + margin.inline_start;
|
let pbm = &(&padding + &border) + &margin;
|
||||||
|
ifc.inline_position += pbm.inline_start;
|
||||||
let mut start_corner = Vec2 {
|
let mut start_corner = Vec2 {
|
||||||
block: padding.block_start + border.block_start + margin.block_start,
|
block: pbm.block_start,
|
||||||
inline: ifc.inline_position - ifc.current_nesting_level.inline_start,
|
inline: ifc.inline_position - ifc.current_nesting_level.inline_start,
|
||||||
};
|
};
|
||||||
start_corner += &relative_adjustement(
|
start_corner += &relative_adjustement(
|
||||||
|
@ -437,8 +438,7 @@ fn layout_atomic<'box_tree>(
|
||||||
Err(non_replaced) => {
|
Err(non_replaced) => {
|
||||||
let box_size = atomic.style.box_size();
|
let box_size = atomic.style.box_size();
|
||||||
let inline_size = box_size.inline.percentage_relative_to(cbis).auto_is(|| {
|
let inline_size = box_size.inline.percentage_relative_to(cbis).auto_is(|| {
|
||||||
let available_size =
|
let available_size = cbis - pbm.inline_sum();
|
||||||
cbis - padding.inline_sum() - border.inline_sum() - margin.inline_sum();
|
|
||||||
shrink_to_fit(&atomic.inline_content_sizes, available_size)
|
shrink_to_fit(&atomic.inline_content_sizes, available_size)
|
||||||
});
|
});
|
||||||
let block_size = box_size
|
let block_size = box_size
|
||||||
|
@ -482,8 +482,7 @@ fn layout_atomic<'box_tree>(
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
ifc.inline_position +=
|
ifc.inline_position += pbm.inline_end;
|
||||||
fragment.padding.inline_end + fragment.border.inline_end + fragment.margin.inline_end;
|
|
||||||
ifc.current_nesting_level
|
ifc.current_nesting_level
|
||||||
.fragments_so_far
|
.fragments_so_far
|
||||||
.push(Fragment::Box(fragment));
|
.push(Fragment::Box(fragment));
|
||||||
|
|
|
@ -307,7 +307,7 @@ impl<'a> AbsolutelyPositionedFragment<'a> {
|
||||||
Ok(replaced) => {
|
Ok(replaced) => {
|
||||||
// FIXME: implement https://drafts.csswg.org/css2/visudet.html#abs-replaced-width
|
// FIXME: implement https://drafts.csswg.org/css2/visudet.html#abs-replaced-width
|
||||||
// and https://drafts.csswg.org/css2/visudet.html#abs-replaced-height
|
// and https://drafts.csswg.org/css2/visudet.html#abs-replaced-height
|
||||||
let block_size = block_size.auto_is(|| Length::zero());
|
let block_size = block_size.auto_is(Length::zero);
|
||||||
let fragments = replaced.make_fragments(
|
let fragments = replaced.make_fragments(
|
||||||
&self.absolutely_positioned_box.contents.style,
|
&self.absolutely_positioned_box.contents.style,
|
||||||
Vec2 {
|
Vec2 {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue