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

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

Issue 11091018: Merge 130717 - HTMLSelectElement::typeAheadFind depends on implementation dependent behavior (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1229/
Patch Set: Created 8 years, 2 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/fast/forms/select/select-typeahead-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/html/HTMLSelectElement.cpp
===================================================================
--- Source/WebCore/html/HTMLSelectElement.cpp (revision 130718)
+++ Source/WebCore/html/HTMLSelectElement.cpp (working copy)
@@ -1514,8 +1514,10 @@
return;
int selected = selectedIndex();
- int index = (optionToListIndex(selected >= 0 ? selected : 0) + searchStartOffset) % itemCount;
- ASSERT(index >= 0);
+ int index = optionToListIndex(selected >= 0 ? selected : 0) + searchStartOffset;
+ if (index < 0)
+ return;
+ index %= itemCount;
// 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
« no previous file with comments | « LayoutTests/fast/forms/select/select-typeahead-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698