diff options
author | Martin Robinson <mrobinson@igalia.com> | 2024-04-29 18:58:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-29 16:58:14 +0000 |
commit | f68a2e7743bffef524f1fb6cade9a43f25fc7789 (patch) | |
tree | b958c82d0886858436e2120ad8dae9ca0127c943 /components/layout_2020/flow/construct.rs | |
parent | adcaf2e881fc22bde15bbf37fd970ad1ab57c28c (diff) | |
download | servo-f68a2e7743bffef524f1fb6cade9a43f25fc7789.tar.gz servo-f68a2e7743bffef524f1fb6cade9a43f25fc7789.zip |
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>
Diffstat (limited to 'components/layout_2020/flow/construct.rs')
-rw-r--r-- | components/layout_2020/flow/construct.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/components/layout_2020/flow/construct.rs b/components/layout_2020/flow/construct.rs index 02595e2b3c6..586a109e918 100644 --- a/components/layout_2020/flow/construct.rs +++ b/components/layout_2020/flow/construct.rs @@ -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, })) }, |