Spatial Navigation handling of space key in <select> appears to confuse listIndex and optionIndex.
https://bugs.webkit.org/show_bug.cgi?id=99525

Source/WebCore:

HTMLSelect Element inherently contains the logic to focus option node and thus, implementing an explicit logic to find the focus index is not required.

Patch by Abhijeet Kandalkar <abhijeet.k@samsung.com> on 2013-07-19
Reviewed by Joseph Pecoraro.

Test: fast/spatial-navigation/snav-multiple-select-optgroup.html

* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
* page/SpatialNavigation.cpp:
(WebCore::canScrollInDirection):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::addFocusRingRects):

LayoutTests:

Added testcase to test support of option group within HTMLSelect element.

Patch by Abhijeet Kandalkar <abhijeet.k@samsung.com> on 2013-07-19
Reviewed by Joseph Pecoraro.

* fast/spatial-navigation/snav-multiple-select-optgroup-expected.txt: Added.
* fast/spatial-navigation/snav-multiple-select-optgroup.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152919 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/page/SpatialNavigation.cpp b/Source/WebCore/page/SpatialNavigation.cpp
index 6f277a6..240ca914 100644
--- a/Source/WebCore/page/SpatialNavigation.cpp
+++ b/Source/WebCore/page/SpatialNavigation.cpp
@@ -448,6 +448,10 @@
 bool canScrollInDirection(const Node* container, FocusDirection direction)
 {
     ASSERT(container);
+
+    if (container->hasTagName(HTMLNames::selectTag))
+        return false;
+
     if (container->isDocumentNode())
         return canScrollInDirection(toDocument(container)->frame(), direction);