mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
layout: Ensure empty list items are at least as tall as outside markers (#32152)
While <https://drafts.csswg.org/css-lists/#list-style-position-property> says: > The size or contents of the marker box may affect the height of the > principal block box and/or the height of its first line box, and in some > cases may cause the creation of a new line box; this interaction is also > not defined. All other browsers ensure that the first line of list item content is the same block size as the marker. Doing this is complicated, but we can ensure that the entire list item is at least as tall as the marker. This should handle the majority of cases and we can make refinements later for stranger situations, such as when the marker is very tall. Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
adcaf2e881
commit
f68a2e7743
13 changed files with 93 additions and 30 deletions
|
@ -790,17 +790,17 @@ where
|
|||
&PseudoElement::ServoLegacyText, // FIMXE: use `PseudoElement::Marker` when we add it
|
||||
&info.style,
|
||||
);
|
||||
let info = info.new_replacing_style(marker_style.clone());
|
||||
let contents = NonReplacedContents::OfPseudoElement(contents);
|
||||
let block_container = BlockContainer::construct(
|
||||
context,
|
||||
&info,
|
||||
&info.new_replacing_style(marker_style.clone()),
|
||||
contents,
|
||||
TextDecorationLine::empty(),
|
||||
false, /* is_list_item */
|
||||
);
|
||||
ArcRefCell::new(BlockLevelBox::OutsideMarker(OutsideMarker {
|
||||
style: marker_style,
|
||||
marker_style,
|
||||
list_item_style: info.style.clone(),
|
||||
block_container,
|
||||
}))
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue