You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Text locator count and nth lookups take seconds on large repeated lists #3238
Text locator operations become disproportionately slow on pages with thousands of matching elements. Even reading the third match can take several seconds.
A local benchmark with 10,000 text matches measured median times of:
count(): 4,124 ms.
nth(2).innerText(): 12,498 ms.
Results were correct, but lookup cost made these operations impractical on large lists. Timings depend on the machine and browser.
Expected behavior
Counting and selecting one match should avoid repeated pairwise comparisons and resolving remote handles for every match.
The example should return 10,000 and "Repeated label 2" without multi-second overhead. Match order, innermost-element semantics, shadow-root behavior, and cancellation should remain correct.
Technical details
Text matching repeatedly scans candidates to eliminate matching ancestors. Indexed resolution also resolves more matches than the requested operation needs.
Activity