Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d0755e594a1868366743dd4331b301ceebb4a804
      
https://github.com/WebKit/WebKit/commit/d0755e594a1868366743dd4331b301ceebb4a804
  Author: Antti Koivisto <[email protected]>
  Date:   2026-09-17 (Thu, 17 Sep 2026)

  Changed paths:
    A LayoutTests/fast/block/deeply-nested-blocks-are-rendered-expected.txt
    A LayoutTests/fast/block/deeply-nested-blocks-are-rendered.html
    A LayoutTests/fast/block/nested-inline-formatting-context-limit-expected.txt
    A LayoutTests/fast/block/nested-inline-formatting-context-limit.html
    M Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
    M Source/WebCore/style/StyleTreeResolver.cpp
    M Source/WebCore/style/StyleTreeResolver.h
    M Source/WebKit/Shared/WebPreferencesDefaultValues.cpp
    M Source/WebKit/Shared/WebPreferencesDefaultValues.h

  Log Message:
  -----------
  Deeply nested block content fails to render in iOS Mail
https://bugs.webkit.org/show_bug.cgi?id=319674
rdar://182051357

Reviewed by Alan Baradlay.

The existing cap on render tree depth is based on simple nesting depth.

This patch adds a separate limit based on counting nested inline formatting 
contexts.
Deep IFC nesting is what actually causes stack exhaustion issues.

* LayoutTests/fast/block/deeply-nested-blocks-are-rendered-expected.txt: Added.
* LayoutTests/fast/block/deeply-nested-blocks-are-rendered.html: Added.
* LayoutTests/fast/block/nested-inline-formatting-context-limit-expected.txt: 
Added.
* LayoutTests/fast/block/nested-inline-formatting-context-limit.html: Added.
* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:

Add a setting for this instead of hardcoding in Style::TreeResolver..

* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::isInlineBox):
(WebCore::Style::TreeResolver::incrementNestedInlineFormattingContextCountIfNeeded):
(WebCore::Style::TreeResolver::pushParent):
(WebCore::Style::TreeResolver::resolveComposedTree):
(WebCore::Style::TreeResolver::maximumRenderTreeDepth): Deleted.
* Source/WebCore/style/StyleTreeResolver.h:
* Source/WebKit/Shared/WebPreferencesDefaultValues.cpp:

Move the application check here.

(WebKit::defaultMaximumNestedInlineFormattingContextCount):
* Source/WebKit/Shared/WebPreferencesDefaultValues.h:

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



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

Reply via email to