mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
use app unit in box_fragement (#32349)
This commit is contained in:
parent
66edef8065
commit
26c585a0c5
20 changed files with 273 additions and 289 deletions
|
@ -244,10 +244,10 @@ impl OutsideMarker {
|
|||
let max_inline_size = flow_layout.fragments.iter().fold(
|
||||
Length::zero(),
|
||||
|current_max, fragment| match fragment {
|
||||
Fragment::Text(text) => current_max.max(text.rect.max_inline_position()),
|
||||
Fragment::Image(image) => current_max.max(image.rect.max_inline_position()),
|
||||
Fragment::Text(text) => current_max.max(text.rect.max_inline_position().into()),
|
||||
Fragment::Image(image) => current_max.max(image.rect.max_inline_position().into()),
|
||||
Fragment::Positioning(positioning) => {
|
||||
current_max.max(positioning.rect.max_inline_position())
|
||||
current_max.max(positioning.rect.max_inline_position().into())
|
||||
},
|
||||
Fragment::Box(_) |
|
||||
Fragment::Float(_) |
|
||||
|
@ -286,7 +286,7 @@ impl OutsideMarker {
|
|||
base_fragment_info,
|
||||
self.marker_style.clone(),
|
||||
flow_layout.fragments,
|
||||
content_rect,
|
||||
content_rect.into(),
|
||||
LogicalSides::zero(),
|
||||
LogicalSides::zero(),
|
||||
LogicalSides::zero(),
|
||||
|
@ -910,7 +910,7 @@ fn layout_in_flow_non_replaced_block_level_same_formatting_context(
|
|||
base_fragment_info,
|
||||
style.clone(),
|
||||
flow_layout.fragments,
|
||||
content_rect.into(),
|
||||
content_rect,
|
||||
pbm.padding,
|
||||
pbm.border,
|
||||
margin,
|
||||
|
@ -996,7 +996,7 @@ impl NonReplacedFormattingContext {
|
|||
self.base_fragment_info,
|
||||
self.style.clone(),
|
||||
layout.fragments,
|
||||
content_rect.into(),
|
||||
content_rect,
|
||||
pbm.padding,
|
||||
pbm.border,
|
||||
margin,
|
||||
|
@ -1248,7 +1248,7 @@ impl NonReplacedFormattingContext {
|
|||
self.base_fragment_info,
|
||||
self.style.clone(),
|
||||
layout.fragments,
|
||||
content_rect.into(),
|
||||
content_rect,
|
||||
pbm.padding,
|
||||
pbm.border,
|
||||
margin,
|
||||
|
@ -1353,7 +1353,7 @@ fn layout_in_flow_replaced_block_level(
|
|||
base_fragment_info,
|
||||
style.clone(),
|
||||
fragments,
|
||||
content_rect.into(),
|
||||
content_rect,
|
||||
pbm.padding,
|
||||
pbm.border,
|
||||
margin,
|
||||
|
@ -1668,7 +1668,7 @@ impl PlacementState {
|
|||
return;
|
||||
}
|
||||
|
||||
let box_block_offset = box_fragment.content_rect.start_corner.block.into();
|
||||
let box_block_offset = box_fragment.content_rect.start_corner.block;
|
||||
if let (None, Some(first)) = (self.inflow_baselines.first, box_fragment.baselines.first) {
|
||||
self.inflow_baselines.first = Some(first + box_block_offset);
|
||||
}
|
||||
|
@ -1700,14 +1700,14 @@ impl PlacementState {
|
|||
.contains(FragmentFlags::IS_OUTSIDE_LIST_ITEM_MARKER);
|
||||
if is_outside_marker {
|
||||
assert!(self.marker_block_size.is_none());
|
||||
self.marker_block_size = Some(fragment.content_rect.size.block.into());
|
||||
self.marker_block_size = Some(fragment.content_rect.size.block);
|
||||
return;
|
||||
}
|
||||
|
||||
let fragment_block_margins = &fragment.block_margins_collapsed_with_children;
|
||||
let mut fragment_block_size = fragment.padding.block_sum() +
|
||||
fragment.border.block_sum() +
|
||||
fragment.content_rect.size.block.into();
|
||||
fragment.content_rect.size.block;
|
||||
|
||||
// We use `last_in_flow_margin_collapses_with_parent_end_margin` to implement
|
||||
// this quote from https://drafts.csswg.org/css2/#collapsing-margins
|
||||
|
@ -1744,7 +1744,7 @@ impl PlacementState {
|
|||
.adjoin_assign(&fragment_block_margins.start);
|
||||
}
|
||||
fragment.content_rect.start_corner.block +=
|
||||
(self.current_margin.solve() + self.current_block_direction_position).into();
|
||||
self.current_margin.solve() + self.current_block_direction_position;
|
||||
|
||||
if fragment_block_margins.collapsed_through {
|
||||
// `fragment_block_size` is typically zero when collapsing through,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue