Repository navigation
Conversation
|
I'll fix CI failures and address comments from users with write access that start with 'Devin'.
|
Report the collapsible white space at the end of a line separately from the rest of the hanging white space (preserved white space and spaces that never collapse, like the ideographic space).
Style spans can now have an `inline_start` and `inline_end` advance (the inline-axis margin, border and padding of a CSS inline box). They are laid out as `SpanStart`/`SpanEnd` items that are not soft wrap opportunities and stay on the line of the content next to them. `Line::span_fragments` reports the per-line extent of every span box.
- Edges are moved to the visual ends of their span box after bidi reordering, in the direction of the paragraph (CSS 2 § 8.6), and a span box split by reordering yields a fragment for each visual piece. `SpanFragment::is_rtl` is now the direction of the paragraph. - Only collapsible hanging whitespace is excluded from span fragments: preserved whitespace is part of the fragment. - An empty span stays on the line of the content preceding it.
staging-devin-ai-integration
Bot
force-pushed
the
devin/1790968000-inline-span-edges
branch
from
October 3, 2026 12:19
a1708fe to
e6c2e55
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.
LLM Contributions: This PR, including this description, was written by Devin (an LLM agent) at the request of @nicoburns. The description would need rewriting by a human before going upstream, per the Linebender LLM policy.
Stacked on linebender#873 (
LineMetrics::collapsible_hanging_advance, rebased on upstreammain), which is the first commit here and is used to leave collapsible hanging whitespace out of span fragments.Lets a
TreeBuilderstyle span reserve space before and after its content, which is what CSS inline-axis margin + border + padding on a non-atomic inline box needs. The span stays non-atomic: its text is shaped, wrapped and reordered as before.API
TextStyle::inline_start/inline_endandStyleProperty::InlineStart/InlineEnd. Not inherited:push_style_modification_spanresets them unless the modification list sets them, and they are ignored on the root style. Only the tree builder supports them.Line::span_fragments()yields aSpanFragment(style_index,x,advance,baseline,ascent,descent,has_start_edge,has_end_edge,is_rtl) for everypush_style_spanspan with content or an edge on the line, parents before children. Spans without edges get fragments too, so a consumer can use one path for backgrounds and hit rects.Layout::span_edges_mut()to resize edges before (re)breaking lines, analogous toinline_boxes_mut().Behaviour (matches what Chrome does for
box-decoration-break: slice)LayoutItemKind::SpanStart/SpanEnditem with a fixed advance. Items are only created for spans with a non-zero edge or with no content, so other spans cost nothing in shaping or line breaking.Not done
SpanFragment::is_rtlis the paragraph's direction. In CSS the sides depend on the span's owndirection.box-decoration-break: clone.span_edges_mut()only covers spans built with a non-zero edge or without content.Tests are in
parley_tests/tests/styles/span_edges.rs; they compare against reference layouts rather than snapshots.Changelog
Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/38d20c11138046c5a04fb2aa400e7033
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/38d20c11138046c5a04fb2aa400e7033?variant=devin-insiders