SELECT element: Avoid to use listItems() in HTMLSelectElement::selectOption()
Remove listItems() usage from: - HTMLOptionElement::index() - HTMLSelectElement::saveListboxActiveSelection() - HTMLSelectElement::selectedOption() - HTMLSelectElement::deselectItemsWithoutValidation() We use optionList() instead. These changes don't improve computational complexity. However we can avoid to update m_listItems when we add/remove OPTIONs. Other changes: - HTMLSelectElement::updateListBoxSelectioN() needs to be updated to synchronize with saveListboxActiveSelection(). m_cachedStateForActiveSelection now represents OPTIONs instead of listItems, which includes OPTGROUP and HR. - Change the arguments of OptionList and OptionListIterator to |const| so that we can create them in const member functions of HTMLSelectElement. - Remove the optimized fast path in HTMLSelectElement::setRecalcListItems(). We don't use m_listItems in critical paths any longer. So the optimization isn't necessary. This CL improves performance because of the removal of the fast path. blink_perf.dom: select-multiple-add: 1,772 runs/s -> 1,912 runs/s select-single-add: 867.9 runs/s -> 944.7 runs/s select-single-remove: 137.9 runs/s -> 145.5 runs/.s BUG=577989 Review-Url: https://codereview.chromium.org/2131073002 Cr-Commit-Position: refs/heads/master@{#404591}
Showing
Please register or sign in to comment