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

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

Issue 2372913002: fixed <select> element isn't updated after its single option removing. (Closed)
Patch Set: remove anchor element and adjunst some indents Created 4 years, 3 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/LayoutTests/fast/forms/select/select-remove-option-single-expected.html ('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 a344bcde69df0cb2454ba0cc2ee0f00afd10af7c..ca017d1f0dfae2ab4d9ed49c02ccac47dec13ec6 100644
--- a/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
@@ -836,7 +836,7 @@ void HTMLSelectElement::resetToDefaultSelection(ResetReason reason)
}
++optionIndex;
}
- if (!lastSelectedOption && m_size <= 1 && firstEnabledOption && !firstEnabledOption->selected()) {
+ if (!lastSelectedOption && m_size <= 1 && (!firstEnabledOption || (firstEnabledOption && !firstEnabledOption->selected()))) {
selectOption(firstEnabledOption, reason == ResetReasonSelectedOptionRemoved ? 0 : DeselectOtherOptions);
lastSelectedOption = firstEnabledOption;
didChange = true;
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/forms/select/select-remove-option-single-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698