Skip to content

Wire up contain: layout and contain: paint to Taffy - #752

Merged
nicoburns merged 4 commits into
mainfrom
devin/1787098726-wire-up-contain
Aug 19, 2026
Merged

Wire up contain: layout and contain: paint to Taffy#752
nicoburns merged 4 commits into
mainfrom
devin/1787098726-wire-up-contain

Conversation

@nicoburns

@nicoburns nicoburns commented Aug 19, 2026

Copy link
Copy Markdown
Member

Summary

Updates Taffy to a revision that includes the new contain style (DioxusLabs/taffy#1128) and wires up Stylo's computed contain to it:

  • stylo_taffy::convert::contain(input: stylo::Contain, display: stylo::Display) -> taffy::Contain maps the LAYOUT and PAINT flags (other flags have no Taffy layout effect). Containment is not applied to non-atomic inline-level boxes (display: inline with inside: flow), per css-contain-1's applicability rules.
  • TaffyStyloStyle implements the new CoreStyle::contain() accessor, and the eager to_taffy_style conversion sets contain as well.
  • compute_layout_damage in blitz-dom now treats a change to contain as requiring box-tree rebuild, since containment changes formatting-context structure (float containment, margin collapsing).

WPT css/css-contain results: 248 tests passing vs 239 on main (+11 newly passing: independent formatting context, float containment, margin collapsing, and baseline suppression tests; -2: contain-layout-dynamic-004/005.html, which require JavaScript to apply containment dynamically and previously only passed vacuously because both test and ref rendered without containment).

Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/c903534a83f54a6daf2f68f4cc38cf72
Requested by: @nicoburns

WPT results

11 newly passing, 2 newly failing (net +9).

Full diff (13 changed tests)
+ Fail => Pass css/css-contain/contain-content-001.html
+ Fail => Pass css/css-contain/contain-content-002.html
- Pass => Fail css/css-contain/contain-layout-dynamic-004.html
- Pass => Fail css/css-contain/contain-layout-dynamic-005.html
+ Fail => Pass css/css-contain/contain-layout-formatting-context-float-001.html
+ Fail => Pass css/css-contain/contain-layout-formatting-context-margin-001.html
+ Fail => Pass css/css-contain/contain-layout-ifc-022.html
+ Fail => Pass css/css-contain/contain-layout-independent-formatting-context-001.html
+ Fail => Pass css/css-contain/contain-layout-suppress-baseline-002.html
+ Fail => Pass css/css-contain/contain-paint-formatting-context-float-001.html
+ Fail => Pass css/css-contain/contain-paint-formatting-context-margin-001.html
+ Fail => Pass css/css-contain/contain-paint-ifc-011.html
+ Fail => Pass css/css-contain/contain-paint-independent-formatting-context-001.html

Generated by the WPT workflow.

@staging-devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@nicoburns
nicoburns enabled auto-merge (squash) August 19, 2026 11:29
@nicoburns
nicoburns merged commit cca749d into main Aug 19, 2026
14 checks passed
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