Bug 1827025 [wpt PR 39435] - Fix exponential time fieldset disable algorithm, a=testonly
commit53bd4ff017e60c0809c086c411c492aad2a3dd32
authorXiaocheng Hu <xiaochengh@chromium.org>
Thu, 13 Apr 2023 04:35:39 +0000 (13 04:35 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Fri, 14 Apr 2023 11:16:20 +0000 (14 11:16 +0000)
tree47a0bcf0e0bfc7e1c2a2fde71fa881ca3c1036c2
parent1afb77cc96efcaf6cba853cf3398116e9b117532
Bug 1827025 [wpt PR 39435] - Fix exponential time fieldset disable algorithm, a=testonly

Automatic update from web-platform-tests
Fix exponential time fieldset disable algorithm

HTMLFieldSetElement::DisabledAttributeChanged() traverses its subtree,
and recurses on every form control descendant. This causes repeated
traversal on subtrees, and results in exponential overall running time.
The re-entrancy also causes a DCHECK hit when we blur the focused
element in a nested traversal.

This patch optimizes it to linear time by adding a non-reentrant
override of ListedElement::AncestorDisabledStateWasChanged() on
HTMLFieldSetelement.

Fixed: 1427047
Change-Id: Ia3ee4195e71e05724af2bfb9abda6f1e94683ed9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4406688
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Auto-Submit: Xiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1127824}

--

wpt-commits: 5857a9b5776d85fe77883fadf62c398dc05cf608
wpt-pr: 39435
testing/web-platform/tests/html/semantics/forms/the-fieldset-element/disabled-003.html [new file with mode: 0644]