<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>314139</bug_id>
          
          <creation_ts>2026-05-05 17:05:07 -0700</creation_ts>
          <short_desc>REGRESSION (297241@main): Overflow siblings at parser&apos;s max DOM tree depth get fully rendered, causing slow layout</short_desc>
          <delta_ts>2026-05-11 11:26:44 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="zak ridouh">zakr</reporter>
          <assigned_to name="zak ridouh">zakr</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2207874</commentid>
    <comment_count>0</comment_count>
    <who name="zak ridouh">zakr</who>
    <bug_when>2026-05-05 17:05:07 -0700</bug_when>
    <thetext>After 297241@main fixed the parser&apos;s DOM depth cap to trigger at exactly 512 (&gt;= instead of &gt;), overflow elements now land at depth 512 instead of 513. The render tree&apos;s depth check at StyleTreeResolver only skips depth &gt; 512, so the overflow siblings now pass through and get fully styled and laid out.

Content with thousands of overflow siblings for example, a Mail message embedding a crash log with many unmatched &lt;unavailable&gt; tags produces ~1500 sibling inline boxes at the boundary depth. Inline layout then walks the ancestor chain per box (LineBox::parentInlineBox / inlineLevelBoxAbsoluteTop), giving O(depth × N) and ~15s render times.

Fix it with the following: at the maximum render tree depth, skip elements that have a previous element sibling. The single legitimate deepest element keeps its renderer; the overflow run gets none.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2207876</commentid>
    <comment_count>1</comment_count>
    <who name="zak ridouh">zakr</who>
    <bug_when>2026-05-05 17:05:27 -0700</bug_when>
    <thetext>&lt;rdar://172219636&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2207893</commentid>
    <comment_count>2</comment_count>
    <who name="zak ridouh">zakr</who>
    <bug_when>2026-05-05 17:25:51 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/64319</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2208356</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-05-06 16:37:48 -0700</bug_when>
    <thetext>Committed 312751@main (69a399de80ab): &lt;https://commits.webkit.org/312751@main&gt;

Reviewed commits have been landed. Closing PR #64319 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2209801</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-05-11 11:26:44 -0700</bug_when>
    <thetext>Committed 305877.486@webkitglib/2.52 (024db5335281): &lt;https://commits.webkit.org/305877.486@webkitglib/2.52&gt;

Reviewed commits have been landed. Closing PR #64674 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>