Skip to content

LibWeb: Skip empty atomic blocks during intrinsic layout - #11224

Merged
awesomekling merged 1 commit into
LadybirdBrowser:masterfrom
awesomekling:empty-inline-blocque
Aug 20, 2026
Merged

LibWeb: Skip empty atomic blocks during intrinsic layout#11224
awesomekling merged 1 commit into
LadybirdBrowser:masterfrom
awesomekling:empty-inline-blocque

Conversation

@awesomekling

Copy link
Copy Markdown
Member

Size empty atomic block roots directly in the parent measurement instead of constructing child formatting-context runs during min-content and max-content layout. Root sizing continues to resolve box model metrics, constraints, and automatic block size.

This removes tens of thousands of empty measurement runs from StyleBench while preserving coverage through the layout cache scenario matrix.

Benchmark    Old Score     New Score       Score Improvement  Old Total Time (ms)    New Total Time (ms)      Speedup
-----------  ------------  ------------  -------------------  ---------------------  ---------------------  ---------
StyleBench   63.22 ± 5.46  65.25 ± 4.86                1.032  4.02 ± 0.31            3.91 ± 0.27                1.029

Size empty atomic block roots directly in the parent measurement instead
of constructing child formatting-context runs during min-content and
max-content layout. Root sizing continues to resolve box model metrics,
constraints, and automatic block size.

This removes tens of thousands of empty measurement runs from StyleBench
while preserving coverage through the layout cache scenario matrix.
@coderabbitai

coderabbitai Bot commented Aug 19, 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: 3d08e89b-a8f8-48b6-a88f-18743bfe403c

📥 Commits

Reviewing files that changed from the base of the PR and between dee0370 and 8a5d831.

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

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

During intrinsic sizing, empty atomic block children use a direct sizing path when independent context execution is not required. The parent dimensions the child, resolves its automatic block size to zero, and returns Skipped. This avoids constructing and running an independent formatting context for the empty child.

Possibly related PRs

Suggested reviewers: kalenikaliaksandr

Merge Risk: ⚪ Minimal · up to 8a5d8

This localized layout optimization has no actionable merge-blocking risk remaining and is merge-ready after normal checks and review.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description directly explains the intrinsic layout optimization and its reported StyleBench performance improvement.
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.

@awesomekling
awesomekling merged commit 4ec4a62 into LadybirdBrowser:master Aug 20, 2026
15 checks passed
@awesomekling
awesomekling deleted the empty-inline-blocque branch August 20, 2026 06:39
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