Index: Source/WebCore/html/HTMLSelectElement.cpp |
=================================================================== |
--- Source/WebCore/html/HTMLSelectElement.cpp (revision 130857) |
+++ Source/WebCore/html/HTMLSelectElement.cpp (working copy) |
@@ -1514,10 +1514,8 @@ |
return; |
int selected = selectedIndex(); |
- int index = optionToListIndex(selected >= 0 ? selected : 0) + searchStartOffset; |
- if (index < 0) |
- return; |
- index %= itemCount; |
+ int index = (optionToListIndex(selected >= 0 ? selected : 0) + searchStartOffset) % itemCount; |
+ ASSERT(index >= 0); |
// Compute a case-folded copy of the prefix string before beginning the search for |
// a matching element. This code uses foldCase to work around the fact that |