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. |