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

Unified Diff: Source/core/rendering/RenderMenuList.cpp

Issue 138433002: Add Autofill preview support for <select> input fields (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Initialize m_suggestedIndex in constructor Created 6 years, 9 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 | « Source/core/rendering/RenderListBox.cpp ('k') | Source/core/testing/Internals.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderMenuList.cpp
diff --git a/Source/core/rendering/RenderMenuList.cpp b/Source/core/rendering/RenderMenuList.cpp
index 5b28b71bb3d84b4cd73f0abdc16aae52d9144f0c..5d7457a8ccfe6d054a7483aa3c77dda0c9350eef 100644
--- a/Source/core/rendering/RenderMenuList.cpp
+++ b/Source/core/rendering/RenderMenuList.cpp
@@ -201,10 +201,14 @@ void RenderMenuList::updateFromElement()
m_optionsChanged = false;
}
- if (m_popupIsVisible)
+ if (m_popupIsVisible) {
m_popup->updateFromElement();
- else
- setTextFromOption(selectElement()->selectedIndex());
+ } else {
+ if (selectElement()->suggestedIndex() >= 0)
+ setTextFromOption(selectElement()->suggestedIndex());
+ else
+ setTextFromOption(selectElement()->selectedIndex());
+ }
}
void RenderMenuList::setTextFromOption(int optionIndex)
« no previous file with comments | « Source/core/rendering/RenderListBox.cpp ('k') | Source/core/testing/Internals.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698