Repository navigation
Conversation
|
I'll fix CI failures and address comments from users with write access that start with 'Devin'.
|
TreeBuilder::text_so_farTreeBuilder::text_so_far; process tree builder text eagerly
TreeBuilder::text_so_far; process tree builder text eagerlyTreeBuilder::text and has_pending_whitespace; process tree builder text eagerly
staging-devin-ai-integration
Bot
force-pushed
the
devin/1790425683-tree-builder-text-so-far
branch
from
September 28, 2026 20:13
d1781b8 to
fe83c41
Compare
White space processing no longer needs to see a span's text all at once, so push_text processes text immediately. This makes text_so_far a read-only getter.
staging-devin-ai-integration
Bot
force-pushed
the
devin/1790425683-tree-builder-text-so-far
branch
from
September 28, 2026 20:21
fe83c41 to
6e57520
Compare
Co-authored-by: Tom Churchman <thomas@churchman.nl>
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.
LLM Contributions: Code and this description were written by Devin (an LLM agent). The description needs rewriting by a human before this goes upstream.
Adds two getters to
TreeBuilder:text(&self) -> &strreturns the text pushed so far, after white space processing. Trailing collapsible whitespace is not included.has_pending_whitespace(&self) -> boolreports whether there is trailing collapsible whitespace. It becomes a single space if more content follows, or is removed otherwise.Blitz needs these for
text-transform: capitalize, which has to find word boundaries in the text before the current text node (DioxusLabs/blitz#947).To keep the getters read-only,
TreeStyleBuilderno longer buffers text inuncommitted_text, andpush_textnow applies white space processing straight away. The buffer was needed when collapsing trimmed whitespace at each span's start and end, which required all of a span's text before processing. Since linebender#786 that is handled by the streamingpending_whitespacestate.splitting_text_does_not_affect_white_space_processingchecks that splitting text acrosspush_textcalls at any char boundary gives the same text and style runs, in all fourWhiteSpaceCollapsemodes.Performance was measured with
TreeBuilderbenchmarks that are kept separately in the draft PR stacked on this one. Tango comparison against the buffered version:push, 10 chars perpush_text(1 or 8 pushes per span): 0% to 41% faster. For example, latin 8000 chars with Preserve and 1 push per span went from 33.5 µs to 24.5 µs. The buffered version allocated a new buffer for every span.push, 1 char perpush_textwith 10 pushes per span, the worst case: up to 31% slower, about 2–4 ns more per call.build, including shaping: between −3% and +1.2%.Changelog
Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/4641a2bf5eca4d4fb140d16886180423
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/4641a2bf5eca4d4fb140d16886180423?variant=devin-insiders
Requested by: @nicoburns