Handle all white-space values when intrinsically sizing an IFC (#33343)

There were various cases like `text-wrap-mode: nowrap` and
`white-space-collapse: break-spaces` that weren't handled well.

Fixes #33335

flexbox_flex-formatting-interop.html fails now because we don't support
`table-layout: fixed`.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Oriol Brufau 2024-09-12 01:50:45 +02:00 committed by GitHub
parent 777fb81260
commit d9be9d6bd4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 351 additions and 45 deletions

View file

@ -446,6 +446,11 @@ pub struct GlyphStore {
/// Whether or not this glyph store contains only glyphs for whitespace.
is_whitespace: bool,
/// Whether or not this glyph store ends with whitespace glyphs.
/// Typically whitespace glyphs are placed in a separate store,
/// but that may not be the case with `white-space: break-spaces`.
ends_with_whitespace: bool,
/// Whether or not this glyph store contains only a single glyph for a single
/// preserved newline.
is_single_preserved_newline: bool,
@ -460,6 +465,7 @@ impl<'a> GlyphStore {
pub fn new(
length: usize,
is_whitespace: bool,
ends_with_whitespace: bool,
is_single_preserved_newline: bool,
is_rtl: bool,
) -> GlyphStore {
@ -472,6 +478,7 @@ impl<'a> GlyphStore {
total_word_separators: 0,
has_detailed_glyphs: false,
is_whitespace,
ends_with_whitespace,
is_single_preserved_newline,
is_rtl,
}
@ -492,6 +499,11 @@ impl<'a> GlyphStore {
self.is_whitespace
}
#[inline]
pub fn ends_with_whitespace(&self) -> bool {
self.ends_with_whitespace
}
#[inline]
pub fn total_word_separators(&self) -> usize {
self.total_word_separators