Bug 24889 - Shortening a <select>'s length is n^2
Summary: Shortening a <select>'s length is n^2
Status: RESOLVED DUPLICATE of bug 24876
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2009-03-27 09:48 PDT by Peter Kasting
Modified: 2009-03-27 09:58 PDT (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Peter Kasting 2009-03-27 09:48:06 PDT
LayoutTests/fast/forms/select-max-length.html sets the length of a 10,000 item select to 0.

This takes a ridiculously long time.  Looking in HTMLSelectElement::setLength(), when we shorten a select to length n, we do it by repeatedly removing the element at position n, which moves the whole rest of the list up to fill in the hole.

I'm not sure what the required semantics of this operation are, but removing all these elements at once, or at least removing them from length() down to n, would both be much better.
Comment 1 Peter Kasting 2009-03-27 09:52:06 PDT
CCing hyatt because he'll know the right people to care about perf here.
Comment 2 Mark Rowe (bdash) 2009-03-27 09:58:03 PDT

*** This bug has been marked as a duplicate of 24876 ***