Add BoxFragment::is_inline_box() (#34233)

A helper function to check for inline boxes.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Oriol Brufau 2024-11-12 16:50:20 +01:00 committed by GitHub
parent ae029242f8
commit bf75f17348
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 10 deletions

View file

@ -248,12 +248,7 @@ fn resolved_size_should_be_used_value(fragment: &Fragment) -> bool {
// https://drafts.csswg.org/css-sizing-3/#preferred-size-properties
// > Applies to: all elements except non-replaced inlines
match fragment {
Fragment::Box(box_fragment) => {
!box_fragment.style.get_box().display.is_inline_flow() ||
fragment
.base()
.is_some_and(|base| base.flags.contains(FragmentFlags::IS_REPLACED))
},
Fragment::Box(box_fragment) => !box_fragment.is_inline_box(),
Fragment::Float(_) |
Fragment::Positioning(_) |
Fragment::AbsoluteOrFixedPositioned(_) |