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

Unified Diff: third_party/WebKit/Source/core/html/HTMLSelectElement.cpp

Issue 2105863003: Improve performance of SELECT element by optimizing Vector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp b/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
index bafe8c6c7bc0c6610adc5141060677d0811e793d..d92918ec16011df5bacaa829034e9a3027e132af 100644
--- a/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
@@ -651,7 +651,7 @@ void HTMLSelectElement::setActiveSelectionAnchor(HTMLOptionElement* option)
// 3. Drag the mouse pointer onto the fourth OPTION
// m_activeSelectionEndIndex = 3, options at 1-3 indices are selected.
// updateListBoxSelection needs to clear selection of the fifth OPTION.
- m_cachedStateForActiveSelection.clear();
+ m_cachedStateForActiveSelection.resize(0);
for (auto& element : listItems()) {
m_cachedStateForActiveSelection.append(isHTMLOptionElement(*element) && toHTMLOptionElement(element)->selected());
}
@@ -800,7 +800,7 @@ void HTMLSelectElement::setRecalcListItems()
void HTMLSelectElement::recalcListItems() const
{
TRACE_EVENT0("blink", "HTMLSelectElement::recalcListItems");
- m_listItems.clear();
+ m_listItems.resize(0);
sof 2016/06/29 05:43:24 Isn't there a risk of m_listItem's backing store n
tkent 2016/06/29 06:07:46 There is. But I guess such scenario is not common.
m_shouldRecalcListItems = false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698