Improve performance to remove OPTIONs from a single-selection SELECT.

LayoutMenuList::updateOptionsHeightWidth() is an O(n) function to get maximum
OPTION width and height.

We had a bad performance because it is called whenever we remove a selected
OPTION from a SELECT. This CL changes the timing of updateOptionsHeightWidth().

Old:
  It was called by updateFromElement() after an OPTION is
  added/removed. updateOptionsHeightWidth() makes layout dirty only if maximum
  width/height was changed.

New:
  OPTION addition/removal makes maximum width/height dirty and makes layout
  dirty, and updateOptionsHeightWidth() is called only if the maximum
  width/height is referred.

The new behavior makes layout dirty more frequently, however it reduces the
number of updateOptionsHeightWidth() calls significantly.

This CL makes PerformanceTests/DOM/select-single-remove.html faster.
On my local machine, 5.1 runs/s -> 45.1 runs/s

Test update:
* http/tests/webfont/popup-menu-load-webfont-after-open.html
  LayoutMenuList correctly updates its width and height after this CL.
* fast/repaint/control-clip.html
  Extra invalidation as expected.

BUG=620142

Review-Url: https://codereview.chromium.org/2077343002
Cr-Commit-Position: refs/heads/master@{#400903}
5 files changed