mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
layout: Eliminate extra stored style on outside markers (#36471)
This is a duplicate of the style stored on the marker's `LayoutBoxBase`. Testing: This is covered by existings WPT tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
601517e3aa
commit
0c8bb8287a
2 changed files with 3 additions and 5 deletions
|
@ -705,7 +705,6 @@ where
|
||||||
false, /* is_list_item */
|
false, /* is_list_item */
|
||||||
);
|
);
|
||||||
ArcRefCell::new(BlockLevelBox::OutsideMarker(OutsideMarker {
|
ArcRefCell::new(BlockLevelBox::OutsideMarker(OutsideMarker {
|
||||||
marker_style: info.style.clone(),
|
|
||||||
base: LayoutBoxBase::new(info.into(), info.style.clone()),
|
base: LayoutBoxBase::new(info.into(), info.style.clone()),
|
||||||
block_container,
|
block_container,
|
||||||
list_item_style,
|
list_item_style,
|
||||||
|
|
|
@ -246,7 +246,6 @@ pub(crate) struct CollapsibleWithParentStartMargin(bool);
|
||||||
/// for a list that has `list-style-position: outside`.
|
/// for a list that has `list-style-position: outside`.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub(crate) struct OutsideMarker {
|
pub(crate) struct OutsideMarker {
|
||||||
pub marker_style: Arc<ComputedValues>,
|
|
||||||
pub list_item_style: Arc<ComputedValues>,
|
pub list_item_style: Arc<ComputedValues>,
|
||||||
pub base: LayoutBoxBase,
|
pub base: LayoutBoxBase,
|
||||||
pub block_container: BlockContainer,
|
pub block_container: BlockContainer,
|
||||||
|
@ -271,7 +270,7 @@ impl OutsideMarker {
|
||||||
collapsible_with_parent_start_margin: Option<CollapsibleWithParentStartMargin>,
|
collapsible_with_parent_start_margin: Option<CollapsibleWithParentStartMargin>,
|
||||||
) -> Fragment {
|
) -> Fragment {
|
||||||
let constraint_space = ConstraintSpace::new_for_style_and_ratio(
|
let constraint_space = ConstraintSpace::new_for_style_and_ratio(
|
||||||
&self.marker_style,
|
&self.base.style,
|
||||||
None, /* TODO: support preferred aspect ratios on non-replaced boxes */
|
None, /* TODO: support preferred aspect ratios on non-replaced boxes */
|
||||||
);
|
);
|
||||||
let content_sizes = self.inline_content_sizes(layout_context, &constraint_space);
|
let content_sizes = self.inline_content_sizes(layout_context, &constraint_space);
|
||||||
|
@ -280,7 +279,7 @@ impl OutsideMarker {
|
||||||
inline: content_sizes.sizes.max_content,
|
inline: content_sizes.sizes.max_content,
|
||||||
block: SizeConstraint::default(),
|
block: SizeConstraint::default(),
|
||||||
},
|
},
|
||||||
style: &self.marker_style,
|
style: &self.base.style,
|
||||||
};
|
};
|
||||||
|
|
||||||
// A ::marker can't have a stretch size (must be auto), so this doesn't matter.
|
// A ::marker can't have a stretch size (must be auto), so this doesn't matter.
|
||||||
|
@ -349,7 +348,7 @@ impl OutsideMarker {
|
||||||
|
|
||||||
Fragment::Box(ArcRefCell::new(BoxFragment::new(
|
Fragment::Box(ArcRefCell::new(BoxFragment::new(
|
||||||
base_fragment_info,
|
base_fragment_info,
|
||||||
self.marker_style.clone(),
|
self.base.style.clone(),
|
||||||
flow_layout.fragments,
|
flow_layout.fragments,
|
||||||
content_rect.as_physical(Some(containing_block)),
|
content_rect.as_physical(Some(containing_block)),
|
||||||
PhysicalSides::zero(),
|
PhysicalSides::zero(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue