SELECT element: Remove optionIndex argument of HTMLSelectElement::selectOption().
selectOption() doesn't need optionIndex now. So this CL removes the optionIndex
argument of selectOption(), and removes a selectOption(optionIndex, flags) variant.
Existing callsites of selectOption(optionIndex, flags) are updated:
- If a callsite knows HTMLOptionElement pointed by the optionIndex, the
HTMLOptionElement should be passed to selectOption().
- If not, we use HTMLSelectElement::item(optionIndex) to get an
HTMLOptionElement pointer.
This CL improves performance because we skip to calculate optionIndex from an
HTMLOptionElement in some cases.
blink_perf.dom:
select-multiple-add: 1553 runs/s -> 1787 runs/s
select-single-add: 801 runs/s -> 940 runs/s
select-single-remove: 135 runs/s -> 146 runs/s
BUG=577989
Review-Url: https://codereview.chromium.org/2134553002
Cr-Commit-Position: refs/heads/master@{#404317}
2 files changed