Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 69a399de80ab627e8f02ee00abd0e78904eec10c
      
https://github.com/WebKit/WebKit/commit/69a399de80ab627e8f02ee00abd0e78904eec10c
  Author: Zak Ridouh <[email protected]>
  Date:   2026-05-06 (Wed, 06 May 2026)

  Changed paths:
    A PerformanceTests/Layout/deep-nesting-overflow-siblings.html
    M Source/WebCore/style/StyleTreeResolver.cpp

  Log Message:
  -----------
  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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to