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

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

Issue 204433002: Selecting OptGroup label does not deselect selected item (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated platform mac expectation file Created 6 years, 8 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 | « LayoutTests/platform/mac/fast/forms/select/optgroup-clicking-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLSelectElement.cpp
diff --git a/Source/core/html/HTMLSelectElement.cpp b/Source/core/html/HTMLSelectElement.cpp
index 14b30889fbb04557c7b3011a44ea6fedf630e811..c8048639fec41b3e2d5965ea3bb63653b9cfc1c9 100644
--- a/Source/core/html/HTMLSelectElement.cpp
+++ b/Source/core/html/HTMLSelectElement.cpp
@@ -1283,6 +1283,11 @@ void HTMLSelectElement::updateSelectedState(int listIndex, bool multi, bool shif
{
ASSERT(listIndex >= 0);
+ HTMLElement* clickedElement = listItems()[listIndex];
+ ASSERT(clickedElement);
+ if (isHTMLOptGroupElement(clickedElement))
+ return;
+
// Save the selection so it can be compared to the new selection when
// dispatching change events during mouseup, or after autoscroll finishes.
saveLastSelection();
@@ -1292,8 +1297,6 @@ void HTMLSelectElement::updateSelectedState(int listIndex, bool multi, bool shif
bool shiftSelect = m_multiple && shift;
bool multiSelect = m_multiple && multi && !shift;
- HTMLElement* clickedElement = listItems()[listIndex];
- ASSERT(clickedElement);
if (isHTMLOptionElement(*clickedElement)) {
// Keep track of whether an active selection (like during drag
// selection), should select or deselect.
« no previous file with comments | « LayoutTests/platform/mac/fast/forms/select/optgroup-clicking-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698