Implement white space collapsing - #176
Merged
Merged
Conversation
afishhh
force-pushed
the
whitespace-collapse
branch
3 times, most recently
from
May 23, 2026 11:58
9b9e34c to
b854416
Compare
afishhh
marked this pull request as ready for review
May 23, 2026 12:26
afishhh
force-pushed
the
whitespace-collapse
branch
from
May 23, 2026 22:52
b854416 to
6ebe476
Compare
Storing span length gets problematic if one wants to start modifying the item list while building it (like when collapsing whitespace). Instead signal the end of a span with a separate `SpanEnd` item. This actually slightly simplifies the iteration code and makes spans smaller so is probably worth doing anyway.
afishhh
force-pushed
the
whitespace-collapse
branch
from
June 20, 2026 16:06
6ebe476 to
6ab41a7
Compare
Owner
Author
|
Last commit switches the module organization to something that actually makes sense. I would love to have it (moving builder to |
afishhh
force-pushed
the
whitespace-collapse
branch
from
June 20, 2026 17:43
74cf817 to
f476403
Compare
afishhh
force-pushed
the
whitespace-collapse
branch
from
June 20, 2026 17:53
f476403 to
7539b47
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See https://drafts.csswg.org/css-text-4/#white-space-phase-1
See doc comment of
subrandr::layout::inline::WhiteSpaceCollapseInternalDocfor implementation sketch.TODO:
preserve-spacesand use it for WebVTT.White space hanging is future work but I already have a prototype locally.
Note that
white-space-collapse: collapsedoes not have an internal use, it's here as part of my goal of supporting CSS defaults so that a future layout (C) API can use actual CSS defaults as a defaultComputedStyle.