layout: Avoid setting baseline for phantom line boxes (#39055)

Phantom line boxes should be treated as non-existing for most purposes,
so don't let them affect the baseline of their block container.

Testing: An existing test passes, and also adding a new one which
doesn't rely on `<button>`

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Oriol Brufau 2025-09-01 04:52:17 +02:00 committed by GitHub
parent dc7fca5c79
commit 6e92e1d7d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 73 additions and 5 deletions

View file

@ -993,9 +993,11 @@ impl InlineFormattingContextLayout<'_> {
return;
}
let baseline = baseline_offset + block_start_position;
self.baselines.first.get_or_insert(baseline);
self.baselines.last = Some(baseline);
if line_to_layout.has_content {
let baseline = baseline_offset + block_start_position;
self.baselines.first.get_or_insert(baseline);
self.baselines.last = Some(baseline);
}
// The inline part of this start offset was taken into account when determining
// the inline start of the line in `calculate_inline_start_for_current_line` so