Skip to content

REGRESSION (297241@main): Overflow siblings at parser's max DOM tree depth get fully rendered, causing slow layout - #64319

Merged
webkit-commit-queue merged 1 commit into
WebKit:mainfrom
zakariaridouh:eng/REGRESSION-297241-main-Overflow-siblings-at-parser-s-max-DOM-tree-depth-get-fully-rendered-causing-slow-layout
May 6, 2026
Merged

webkit-commit-queue merged 1 commit into
WebKit:mainfrom
zakariaridouh:eng/REGRESSION-297241-main-Overflow-siblings-at-parser-s-max-DOM-tree-depth-get-fully-rendered-causing-slow-layout

Conversation

@zakariaridouh

@zakariaridouh zakariaridouh commented May 6, 2026 •

Copy link
Copy Markdown
Contributor

69a399d

REGRESSION (297241@main): Overflow siblings at parser's max DOM tree depth get fully rendered, causing slow layout
https://bugs.webkit.org/show_bug.cgi?id=314139
rdar://172219636

Reviewed by Sammy Gill and Alan Baradlay.

When the parser's DOM depth cap is reached, HTMLConstructionSite::attachLater
attaches further elements as siblings at the boundary depth (see 297241@main).
The render tree's depth check skipped elements above the cap but not at it,
so the overflow run was fully styled and laid out — causing ~15s render times
on content with thousands of overflow siblings (e.g. mail with embedded crash
logs containing unmatched <unavailable> tags).

At the maximum render tree depth, skip elements that have a previous element
sibling. The single legitimate deepest element keeps its renderer; the
overflow siblings get none.

* PerformanceTests/Layout/deep-nesting-overflow-siblings.html: Added.
* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveComposedTree):

Canonical link: https://commits.webkit.org/312751@main

d0c4f04

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows Apple Internal
✅ 🧪 style   🛠 ios ✅ 🛠 mac ✅ 🛠 wpe   🛠 win loading 🛠 ios-apple
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug   🧪 wpe-wk2   🧪 win-tests loading 🛠 mac-apple
✅ 🧪 webkitperl   🧪 ios-wk2   🧪 api-mac ✅ 🧪 api-wpe loading 🛠 vision-apple
  🧪 ios-wk2-wpt   🧪 api-mac-debug ✅ 🛠 gtk3-libwebrtc
  🧪 api-ios ✅ 🧪 mac-wk1 ✅ 🛠 gtk
✅ 🛠 ios-safer-cpp ✅ 🧪 mac-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision   🧪 mac-AS-debug-wk2 ❌ 🧪 api-gtk
✅ 🛠 🧪 merge   🛠 vision-sim ✅ 🧪 mac-wk2-stress   🛠 playstation
  🧪 vision-wk2   🧪 mac-intel-wk2
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
  🛠 tv-sim
  🛠 watch
  🛠 watch-sim

@zakariaridouh zakariaridouh self-assigned this May 6, 2026
@zakariaridouh zakariaridouh added the New Bugs Unclassified bugs are placed in this component until the correct component can be determined. label May 6, 2026
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label May 6, 2026
@ruthvikkonda

Copy link
Copy Markdown
Contributor

(not a webkit reviewer), r=me

@zakariaridouh zakariaridouh removed the merging-blocked Applied to prevent a change from being merged label May 6, 2026
@zakariaridouh
zakariaridouh force-pushed the eng/REGRESSION-297241-main-Overflow-siblings-at-parser-s-max-DOM-tree-depth-get-fully-rendered-causing-slow-layout branch from 0a34430 to d0c4f04 Compare May 6, 2026 21:20
@zakariaridouh zakariaridouh added the merge-queue Applied to send a pull request to merge-queue label May 6, 2026
…depth get fully rendered, causing slow layout

https://bugs.webkit.org/show_bug.cgi?id=314139
rdar://172219636

Reviewed by Sammy Gill and Alan Baradlay.

When the parser's DOM depth cap is reached, HTMLConstructionSite::attachLater
attaches further elements as siblings at the boundary depth (see 297241@main).
The render tree's depth check skipped elements above the cap but not at it,
so the overflow run was fully styled and laid out — causing ~15s render times
on content with thousands of overflow siblings (e.g. mail with embedded crash
logs containing unmatched <unavailable> tags).

At the maximum render tree depth, skip elements that have a previous element
sibling. The single legitimate deepest element keeps its renderer; the
overflow siblings get none.

* PerformanceTests/Layout/deep-nesting-overflow-siblings.html: Added.
* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveComposedTree):

Canonical link: https://commits.webkit.org/312751@main
@webkit-commit-queue
webkit-commit-queue force-pushed the eng/REGRESSION-297241-main-Overflow-siblings-at-parser-s-max-DOM-tree-depth-get-fully-rendered-causing-slow-layout branch from d0c4f04 to 69a399d Compare May 6, 2026 23:37
@webkit-commit-queue

Copy link
Copy Markdown
Collaborator

Committed 312751@main (69a399d): https://commits.webkit.org/312751@main

Reviewed commits have been landed. Closing PR #64319 and removing active labels.

@webkit-commit-queue
webkit-commit-queue merged commit 69a399d into WebKit:main May 6, 2026
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label May 6, 2026
@zakariaridouh
zakariaridouh deleted the eng/REGRESSION-297241-main-Overflow-siblings-at-parser-s-max-DOM-tree-depth-get-fully-rendered-causing-slow-layout branch June 4, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New Bugs Unclassified bugs are placed in this component until the correct component can be determined.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants