Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 26970a5ac7ec026b06e9da87ff75bc72ce997fcd
      
https://github.com/WebKit/WebKit/commit/26970a5ac7ec026b06e9da87ff75bc72ce997fcd
  Author: Wenson Hsieh <[email protected]>
  Date:   2026-05-14 (Thu, 14 May 2026)

  Changed paths:
    A LayoutTests/fast/text-extraction/max-recursion-depth-cap-expected.html
    A LayoutTests/fast/text-extraction/max-recursion-depth-cap.html
    M Source/WebCore/page/text-extraction/TextExtraction.cpp

  Log Message:
  -----------
  Web process sometimes crashes with excessive stack depth in 
TextExtraction::extractRecursive
https://bugs.webkit.org/show_bug.cgi?id=314772
rdar://177009329

Reviewed by Abrar Rahman Protyasha.

Add a couple of mitigations to prevent crashes due to excessive stack depth:

-   Avoid ever re-traversing the same element (which is theoretically possible 
if layout is
    triggered in the middle of recursive extraction).

-   Enforce a maximum traversal depth and bail early if the stack grows too 
deep.

Test: fast/text-extraction/max-recursion-depth-cap.html

* LayoutTests/fast/text-extraction/max-recursion-depth-cap-expected.html: Added.
* LayoutTests/fast/text-extraction/max-recursion-depth-cap.html: Added.
* Source/WebCore/page/text-extraction/TextExtraction.cpp:
(WebCore::TextExtraction::extractRecursive):

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



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

Reply via email to