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

Issue 2131073002: SELECT element: Avoid to use listItems() in HTMLSelectElement::selectOption() (Closed)

Created:
4 years, 5 months ago by tkent
Modified:
4 years, 5 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

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 Committed: https://crrev.com/3ebd491419a62d22093a68e7ae3820157a32ecb5 Cr-Commit-Position: refs/heads/master@{#404591}

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+38 lines, -86 lines) Patch
M third_party/WebKit/Source/core/html/HTMLOptionElement.cpp View 1 chunk +2 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLSelectElement.h View 3 chunks +3 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLSelectElement.cpp View 8 chunks +28 lines, -70 lines 2 comments Download
M third_party/WebKit/Source/core/html/forms/OptionList.h View 3 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/html/forms/OptionList.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 12 (6 generated)
tkent
Keishi, would you review this please?
4 years, 5 months ago (2016-07-11 00:26:21 UTC) #5
keishi
LGTM https://codereview.chromium.org/2131073002/diff/40001/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp File third_party/WebKit/Source/core/html/HTMLSelectElement.cpp (right): https://codereview.chromium.org/2131073002/diff/40001/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp#newcode879 third_party/WebKit/Source/core/html/HTMLSelectElement.cpp:879: for (const auto option : optionList()) { &?
4 years, 5 months ago (2016-07-11 02:00:39 UTC) #6
tkent
https://codereview.chromium.org/2131073002/diff/40001/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp File third_party/WebKit/Source/core/html/HTMLSelectElement.cpp (right): https://codereview.chromium.org/2131073002/diff/40001/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp#newcode879 third_party/WebKit/Source/core/html/HTMLSelectElement.cpp:879: for (const auto option : optionList()) { On 2016/07/11 ...
4 years, 5 months ago (2016-07-11 02:12:32 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2131073002/40001
4 years, 5 months ago (2016-07-11 02:12:48 UTC) #9
commit-bot: I haz the power
Committed patchset #1 (id:40001)
4 years, 5 months ago (2016-07-11 02:16:28 UTC) #10
commit-bot: I haz the power
4 years, 5 months ago (2016-07-11 02:17:54 UTC) #12
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/3ebd491419a62d22093a68e7ae3820157a32ecb5
Cr-Commit-Position: refs/heads/master@{#404591}

Powered by Google App Engine
This is Rietveld 408576698