SELECT element: Refer to m_lastOnChangeOption in HTMLSelectElement::optionIndexToBeShown().

This is a preparation to remove O(N) operations in optionIndexToBeShown().

Use m_lastOnChangeOption instead of selectedIndex in optionIndexToBeShown(). We
need to update selectOption() too so that m_lastOnChangeOption is updated before
calling LayoutObject::updateFromElement.  LayoutMenuList::updateFromElement
calls optionIndexToBeShown().

selectedIndex() is O(N), and m_lastOnChangeOption->index() is also O(N). So this
CL doesn't change complexity of optionIndexToBeShown().

BUG=577989
R=keishi@chromium.org

Review URL: https://codereview.chromium.org/2127003003 .

Cr-Commit-Position: refs/heads/master@{#404091}
1 file changed