Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Issue 1837463002: Improve conformance of default OPTION selection of SELECT element (Closed)

Created:
4 years, 9 months ago by tkent
Modified:
4 years, 8 months ago
Reviewers:
keishi
CC:
blink-reviews, blink-reviews-html_chromium.org, chromium-reviews, dglazkov+blink
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Improve conformance of default OPTION selection of SELECT element This CL changes the following behavior: * When an OPTION element is removed from the owner SELECT element, default OPTION selection happens immediately * Do not select disabled OPTIONs in default OPTION selection New behavior matches to Firefox, and conforms to the HTML standard. Implementation: - Separate default OPTION selection code from recalcListItems(). recalcListItems() is called lazily. So the timing of default OPTION selection was unclear. Now we can run only default OPTION selection explicitly. We could run default OPTION selection by recalcListItems(). However it was hard to optimize it. We apply the new default OPTION selection function to HTMLSelectElement:: resetImpl(). Default OPTION selection code in resetImpl() and recalcListItems() were inconsistent for disabled OPTION elements. - Remove !isFinisedParsingChildren() hack It was necessary because we needed to call recalcListItems(), which is O(N), to run default OPTION selection. optionInserted() skips default OPTION selection if we already have the selected OPTION. We don't need the hack any longer. Tests: This CL changes the beahvior of fast/forms/select/HTMLOptionElement_selected3.html. It's expected because we run default OPTION selection immediately after adding an OPTION, not run it lazily in HTMLOptionElement::selected(). BUG=335876 Committed: https://crrev.com/8dcbfa5cdab0982e4ebc485a9c8e70e20cef5026 Cr-Commit-Position: refs/heads/master@{#383480}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Renaming to resetToDefaultSelection #

Messages

Total messages: 15 (7 generated)
tkent
Keishi, would you review this please?
4 years, 8 months ago (2016-03-28 00:07:56 UTC) #5
keishi
By removing !isFinisedParsingChildren() hack, won't we call recalcListitems() for every option when all options are ...
4 years, 8 months ago (2016-03-28 01:55:35 UTC) #6
tkent
On 2016/03/28 at 01:55:35, keishi wrote: > By removing !isFinisedParsingChildren() hack, won't we call recalcListitems() ...
4 years, 8 months ago (2016-03-28 03:34:18 UTC) #7
tkent
https://codereview.chromium.org/1837463002/diff/1/third_party/WebKit/Source/core/html/HTMLSelectElement.h File third_party/WebKit/Source/core/html/HTMLSelectElement.h (right): https://codereview.chromium.org/1837463002/diff/1/third_party/WebKit/Source/core/html/HTMLSelectElement.h#newcode196 third_party/WebKit/Source/core/html/HTMLSelectElement.h:196: void resetDefaultSelection(); On 2016/03/28 at 01:55:35, keishi wrote: > ...
4 years, 8 months ago (2016-03-28 03:43:26 UTC) #8
keishi
LGTM
4 years, 8 months ago (2016-03-28 04:29:26 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1837463002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1837463002/20001
4 years, 8 months ago (2016-03-28 04:43:13 UTC) #12
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 8 months ago (2016-03-28 05:03:33 UTC) #13
commit-bot: I haz the power
4 years, 8 months ago (2016-03-28 05:05:11 UTC) #15
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/8dcbfa5cdab0982e4ebc485a9c8e70e20cef5026
Cr-Commit-Position: refs/heads/master@{#383480}

Powered by Google App Engine
This is Rietveld 408576698