DescriptionAvoid tail recursion to mitigate stack exhaustion
This converts tail recursion in findFocusableElementRecursively{Forward,Backward}
to loop.
These functions still use recursion for nested DOMs.
This avoids stack exhaustion in some cases such as a <select> has too many
<option>s (<select> and <option> combination is somewhat special because
they use user-agent shadow DOM and are handled specially).
BUG=445194
TEST=fast/dom/shadow/focus-controller-recursion-crash.html doesn't crash
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=197831
Patch Set 1 : #
Total comments: 12
Patch Set 2 : more recursion to loop conversion #Patch Set 3 : add a layout test #Patch Set 4 : fix for comments. #
Total comments: 1
Patch Set 5 : lower the loop threshold from 100000 to 50000 #
Messages
Total messages: 23 (9 generated)
|