Skip to content

Use the nearest common ancestor's text wrap mode between spans - #101

Open
nicoburns wants to merge 1 commit into
mainfrom
nico/common-ancestor-wrap-mode
Open

nicoburns wants to merge 1 commit into
mainfrom
nico/common-ancestor-wrap-mode

Conversation

@nicoburns

Copy link
Copy Markdown
Member

LLM Contributions: Investigation, implementation, tests.

CSS Text 3 § 5.1 says the white-space of the nearest common ancestor of two characters (or atomic inlines) controls the soft wrap opportunity between them. The line breaker uses the wrap mode of the character before each opportunity. Since linebender#902 turned inline boxes into U+FFFC characters, that gets <span nowrap><img></span><span nowrap><img></span> in a wrappable parent wrong: no break is allowed between the images.

TreeStyleBuilder now remembers the span of the last committed character. When content is committed to a different span and only their common ancestor allows wrapping, it gives that last character its span's wrappable style variant (the wrappable_style_id mechanism collapsed whitespace already uses). Preserved whitespace keeps its style, because whether it hangs depends on its own wrap mode.

In Blitz this fixes WPT css/css-text/line-breaking/line-breaking-030, 031, 032, ic-001, ic-003, white-space/white-space-wrap-after-nowrap-001 and word-break/break-boundary-2-chars-001. Nothing regressed across css-text, CSS2, cssom-view, css-flexbox and css-inline (about 10.5k tests).

Changelog

Fixed

  • The text wrap mode of the nearest common ancestor span now controls soft wrap opportunities at span boundaries, including between inline boxes.

Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/3495a07b81e84e958badc4170c5717af
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/3495a07b81e84e958badc4170c5717af?variant=devin-insiders

@staging-devin-ai-integration

Copy link
Copy Markdown

I'll fix CI failures and address comments from users with write access that start with 'Devin'.

  • Disable automatic comment, CI, and merge conflict monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant