Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1cb22d29f82443d278401a29606aa4f14f11ec31
      
https://github.com/WebKit/WebKit/commit/1cb22d29f82443d278401a29606aa4f14f11ec31
  Author: Sean Patterson <[email protected]>
  Date:   2026-04-13 (Mon, 13 Apr 2026)

  Changed paths:
    A 
LayoutTests/fast/shadow-dom/focus-navigation-many-non-focusable-shadow-hosts-expected.txt
    A 
LayoutTests/fast/shadow-dom/focus-navigation-many-non-focusable-shadow-hosts.html
    M LayoutTests/platform/ios/TestExpectations
    M Source/WebCore/page/FocusController.cpp

  Log Message:
  -----------
  Sequential focus navigation stack overflow with many non-focusable shadow 
hosts
https://bugs.webkit.org/show_bug.cgi?id=311742
rdar://174359369

Reviewed by Ryosuke Niwa and Megan Gardner.

Convert recursive tail calls in nextFocusableElementWithinScope and
previousFocusableElementWithinScope to iterative while loops. When
traversing many consecutive non-focusable shadow hosts (e.g. a large
datalist), the recursive calls could exhaust the stack.

* Source/WebCore/page/FocusController.cpp:
(WebCore::FocusController::nextFocusableElementWithinScope):
(WebCore::FocusController::previousFocusableElementWithinScope):
* 
LayoutTests/fast/shadow-dom/focus-navigation-many-non-focusable-shadow-hosts.html:
 Added.
* 
LayoutTests/fast/shadow-dom/focus-navigation-many-non-focusable-shadow-hosts-expected.txt:
 Added.

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



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

Reply via email to