Skip to content

LibWeb: Bound the inline ancestor walks at the containing block - #11053

Merged
kalenikaliaksandr merged 1 commit into
LadybirdBrowser:masterfrom
kalenikaliaksandr:cherry-pick-86958b683285
Aug 9, 2026
Merged

LibWeb: Bound the inline ancestor walks at the containing block#11053
kalenikaliaksandr merged 1 commit into
LadybirdBrowser:masterfrom
kalenikaliaksandr:cherry-pick-86958b683285

Conversation

@kalenikaliaksandr

Copy link
Copy Markdown
Member

The fragmented-inline-ancestor lookup and the piece-inset chain accumulation walked ancestor chains that terminate only at the first non-inline ancestor or the tree root. Both chains describe state owned by the current inline formatting context, so they must not leave its subtree: when the containing block is itself inline-level with flow inside (an inline list-item root), the old walks could cross into the enclosing context's boxes. Both walks now stop at the containing block.

The fragmented-inline-ancestor lookup and the piece-inset chain
accumulation walked ancestor chains that terminate only at the first
non-inline ancestor or the tree root. Both chains describe state
owned by the current inline formatting context, so they must not
leave its subtree: when the containing block is itself inline-level
with flow inside (an inline list-item root), the old walks could
cross into the enclosing context's boxes. Both walks now stop at the
containing block.
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 33d51bd3-76ae-4d66-a58c-9bfce9ac387b

📥 Commits

Reviewing files that changed from the base of the PR and between 9b13b59 and e7404c3.

📒 Files selected for processing (1)
  • Libraries/LibWeb/Rust/src/layout/inline_formatting_context.rs

📝 Walkthrough

Walkthrough

The inline formatting context now stops ancestor traversal at its containing block. This applies to fragmented inline ancestor lookup and relative inset accumulation.

Changes

Inline formatting context boundaries

Layer / File(s) Summary
Containing-block traversal boundaries
Libraries/LibWeb/Rust/src/layout/inline_formatting_context.rs
nearest_fragmented_inline_ancestor stops at self.containing_block. Relative inset accumulation uses the same boundary instead of an invalid node.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: shannonbooth

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description directly explains the changes to bound both inline ancestor walks at the containing block.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kalenikaliaksandr
kalenikaliaksandr merged commit f0226a2 into LadybirdBrowser:master Aug 9, 2026
14 of 15 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