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

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

Issue 2115783002: Merge "Improve performance of HTMLSelectElement::setActiveSelectionAnchor()." to M52. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
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 | « third_party/WebKit/Source/core/html/HTMLSelectElement.h ('k') | 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 2e8c5f00015959c75756a3c847ed368892124787..d1414269e37d867bc91ba2789f05333648de82ec 100644
--- a/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
@@ -379,6 +379,8 @@ void HTMLSelectElement::parseAttribute(const QualifiedName& name, const AtomicSt
if (inActiveDocument())
lazyReattachIfAttached();
resetToDefaultSelection();
+ if (!usesMenuList())
+ saveListboxActiveSelection();
}
} else if (name == multipleAttr) {
parseMultipleAttribute(value);
@@ -643,7 +645,12 @@ void HTMLSelectElement::saveLastSelection()
void HTMLSelectElement::setActiveSelectionAnchor(HTMLOptionElement* option)
{
m_activeSelectionAnchor = option;
+ if (!usesMenuList())
+ saveListboxActiveSelection();
+}
+void HTMLSelectElement::saveListboxActiveSelection()
+{
// Cache the selection state so we can restore the old selection as the new
// selection pivots around this anchor index.
// Example:
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLSelectElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698