Skip to content

Move Parley behind a compile-time text backend boundary - #1146

Open
nicoburns wants to merge 4 commits into
mainfrom
devin/1791499557-text-boundary-parley
Open

nicoburns wants to merge 4 commits into
mainfrom
devin/1791499557-text-boundary-parley

Conversation

@nicoburns

@nicoburns nicoburns commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Summary

Open Chad's text-boundary-parley branch to run CI and WPT comparison against main.

  • Isolate Parley-specific construction, inline layout, fonts, editing, markers and painting behind statically selected text-backend traits and concrete type aliases. Blitz retains DOM/style/block-layout orchestration.
  • Add and forward the default-enabled parley feature, with CI checks for the default backend and rejection of builds without a text backend.
  • Prepare for Winkin; this PR does not include Winkin integration.

Preserves Chad's two original commits at 0d9d809c26c968cee080e135378902c67bc9fbfd, followed by merges of main to unblock CI. Workflow resolution retains main's removal of redundant jobs and the new backend check. Inline-layout resolution retains the backend delegation and carries main's anonymous-block percentage-height and margin-storage fixes into the relocated code.

Latest local verification: formatting and strict Clippy pass; DOM/paint/script checks with floats, writing-mode and parallel construction pass; 81 blitz-dom unit tests, 266 integration tests (3 ignored), and 27 script DOM tests pass. All 15 CI checks pass on the updated branch; the WPT workflow reports no changes in test results compared to main. Readback allocation/performance changes remain under separate investigation.

Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/6f48224df7114b2983881a081641004e
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/6f48224df7114b2983881a081641004e?variant=devin-insiders
Requested by: @nicoburns

WPT results

No changes in test results compared to main.

Generated by the WPT workflow.

dfrg added 2 commits October 8, 2026 10:31
blitz-dom gains a text module that holds what Blitz asks of a text
backend: the fonts documents lay text out with (TextFonts), a document's
text context (DocumentText), an inline formatting context's layout and
readback (InlineText, InlineLayoutEngine), form-control editing
(EditableText, EditEngine, with an Edit enum of editing operations) and
outside list markers (MarkerEngine). Aliases name the backend's types:
FontContext, TextLayout, TextEditor, MarkerLayout and FaceDescriptors.
text::parley implements them with the code that was spread through the
crate: building the Parley layout, breaking and placing its lines,
PlainEditor, the font metrics provider, @font-face registration and the
Stylo conversions.

The rest of Blitz now goes through the boundary: the document keeps one
TextContext; deferred construction and inline layout call the backend;
the key, IME and pointer handling of text inputs speak Edit; hit testing,
selected text, innerText, Selection offsets and inline fragment rects
read InlineText. blitz-paint's text painting splits into the decorations
any backend's lines share and a Parley module behind paint_inline_layout,
paint_text_input and paint_marker, selected by blitz-dom's
cfg_text_backend! macro.

Behaviour is unchanged.
blitz-dom's parley feature enables the Parley backend and makes Parley an
optional dependency. build.rs reads it into the text_parley cfg, which the
code uses in its place, and without it blitz-dom stops with a compile
error asking for it. system-fonts and complex-scripts enable Parley's
equivalents only where Parley is enabled.

blitz-paint takes its backend from blitz-dom, through blitz-dom's
cfg_text_backend! macro and its re-export of Parley, so the two never
disagree. Every crate with text features forwards parley, in its
defaults: blitz, blitz-shell, blitz-html, blitz-paint,
blitz-vibey-script, blitz-test-harness, dioxus-native, dioxus-native-dom,
the browser, readme, the WPT runner, the tests and the examples. A CI job
checks the default build and that blitz-dom without parley fails to
compile.
@staging-devin-ai-integration

Copy link
Copy Markdown
Contributor

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

This branch has not been deployed

No deployments
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.

2 participants