[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

chang.shu at nokia.com chang.shu at nokia.com
Wed Dec 22 15:31:39 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 2b85c2a6f43adb4a3c2c16bc9ddd1f19b23ccb73
Author: chang.shu at nokia.com <chang.shu at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Nov 5 19:22:11 2010 +0000

    2010-11-05  Chang Shu  <chang.shu at nokia.com>
    
            Reviewed by Antonio Gomes.
    
            Add support for <select> element in single selection mode. We use space to
            trigger arrow key handling for selection change or spatial navigation.
            https://bugs.webkit.org/show_bug.cgi?id=48937
    
            * fast/events/spatial-navigation/resources/spatial-navigation-utils.js:
            (doMove):
            * fast/events/spatial-navigation/snav-single-select-expected.txt:
            * fast/events/spatial-navigation/snav-single-select.html:
    2010-11-05  Chang Shu  <chang.shu at nokia.com>
    
            Reviewed by Antonio Gomes.
    
            Add support for <select> element in single selection mode. We use space to
            trigger arrow key handling for selection change or spatial navigation.
            https://bugs.webkit.org/show_bug.cgi?id=48937
    
            * dom/SelectElement.cpp:
            (WebCore::isSpatialNavigationEnabled):
            (WebCore::SelectElement::menuListDefaultEventHandler):
            (WebCore::SelectElement::listBoxDefaultEventHandler):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71442 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index e0d7afd..cbebe7e 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2010-11-05  Chang Shu  <chang.shu at nokia.com>
+
+        Reviewed by Antonio Gomes.
+
+        Add support for <select> element in single selection mode. We use space to
+        trigger arrow key handling for selection change or spatial navigation.
+        https://bugs.webkit.org/show_bug.cgi?id=48937
+
+        * fast/events/spatial-navigation/resources/spatial-navigation-utils.js:
+        (doMove):
+        * fast/events/spatial-navigation/snav-single-select-expected.txt:
+        * fast/events/spatial-navigation/snav-single-select.html:
+
 2010-11-05  Mihai Parparita  <mihaip at chromium.org>
 
         Unreviewed expectations update for fast/events/click-count.html; it's no longer slow since r46779 sped it up.
diff --git a/LayoutTests/fast/events/spatial-navigation/resources/spatial-navigation-utils.js b/LayoutTests/fast/events/spatial-navigation/resources/spatial-navigation-utils.js
index 5dc750c..e16300d 100644
--- a/LayoutTests/fast/events/spatial-navigation/resources/spatial-navigation-utils.js
+++ b/LayoutTests/fast/events/spatial-navigation/resources/spatial-navigation-utils.js
@@ -53,11 +53,14 @@ function doMove()
   case "Left":
     direction = "leftArrow";
     break;
+  case "Space":
+    direction = " ";
+    break;
   default:
-    return;
+    debug("Action [" + gExpectedResults[gIndex][0] + "] not supported.");
   }
 
-  if (window.layoutTestController)
+  if (window.layoutTestController && direction)
     eventSender.keyDown(direction);
 
   setTimeout(verifyAndAdvance, 15);
diff --git a/LayoutTests/fast/events/spatial-navigation/snav-single-select-expected.txt b/LayoutTests/fast/events/spatial-navigation/snav-single-select-expected.txt
index be55150..25848d4 100644
--- a/LayoutTests/fast/events/spatial-navigation/snav-single-select-expected.txt
+++ b/LayoutTests/fast/events/spatial-navigation/snav-single-select-expected.txt
@@ -9,4 +9,12 @@ PASS gFocusedDocument.activeElement.getAttribute("id") is "6"
 PASS gFocusedDocument.activeElement.getAttribute("id") is "start"
 PASS gFocusedDocument.activeElement.getAttribute("id") is "4"
 PASS gFocusedDocument.activeElement.getAttribute("id") is "start"
+PASS gFocusedDocument.activeElement.getAttribute("id") is "start"
+PASS gFocusedDocument.activeElement.getAttribute("id") is "start"
+PASS gFocusedDocument.activeElement.getAttribute("id") is "start"
+PASS gFocusedDocument.activeElement.getAttribute("id") is "start"
+PASS gFocusedDocument.activeElement.getAttribute("id") is "8"
+PASS gFocusedDocument.getElementById("start").selectedIndex is 0
+PASS gFocusedDocument.getElementById("start").selectedIndex is 1
+PASS gFocusedDocument.getElementById("start").selectedIndex is 0
 
diff --git a/LayoutTests/fast/events/spatial-navigation/snav-single-select.html b/LayoutTests/fast/events/spatial-navigation/snav-single-select.html
index fa7e269..fd768cc 100644
--- a/LayoutTests/fast/events/spatial-navigation/snav-single-select.html
+++ b/LayoutTests/fast/events/spatial-navigation/snav-single-select.html
@@ -23,6 +23,11 @@
       ["Left", "start"],
       ["Left", "4"],
       ["Right", "start"],
+      ["Space", "start"],
+      ["Down", "start"],
+      ["Up", "start"],
+      ["Space", "start"],
+      ["Down", "8"],
       ["DONE", "DONE"]
     ];
 
@@ -38,7 +43,20 @@
       // starting the test itself: get to a known place.
       document.getElementById("start").focus();
 
-      initTest(resultMap, testCompleted);
+      initTest(resultMap, additionalTest);
+    }
+
+    function additionalTest()
+    {
+      document.getElementById("start").focus();
+      shouldBe("gFocusedDocument.getElementById(\"start\").selectedIndex", "0");
+      eventSender.keyDown(" ");
+      eventSender.keyDown("downArrow");
+      shouldBe("gFocusedDocument.getElementById(\"start\").selectedIndex", "1");
+      eventSender.keyDown("upArrow");
+      shouldBe("gFocusedDocument.getElementById(\"start\").selectedIndex", "0");
+
+      testCompleted();
     }
 
     function testCompleted()
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 2a32760..8409971 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-11-05  Chang Shu  <chang.shu at nokia.com>
+
+        Reviewed by Antonio Gomes.
+
+        Add support for <select> element in single selection mode. We use space to
+        trigger arrow key handling for selection change or spatial navigation.
+        https://bugs.webkit.org/show_bug.cgi?id=48937
+
+        * dom/SelectElement.cpp:
+        (WebCore::isSpatialNavigationEnabled):
+        (WebCore::SelectElement::menuListDefaultEventHandler):
+        (WebCore::SelectElement::listBoxDefaultEventHandler):
+
 2010-11-05  Charlie Reis  <creis at chromium.org>
 
         Reviewed by Darin Fisher.
diff --git a/WebCore/dom/SelectElement.cpp b/WebCore/dom/SelectElement.cpp
index 3023668..115f480 100644
--- a/WebCore/dom/SelectElement.cpp
+++ b/WebCore/dom/SelectElement.cpp
@@ -71,6 +71,14 @@ namespace WebCore {
 
 static const DOMTimeStamp typeAheadTimeout = 1000;
 
+static bool isSpatialNavigationEnabled(const Frame* frame)
+{
+    if (frame && frame->settings() && frame->settings()->isSpatialNavigationEnabled())
+        return true;
+
+    return false;
+}
+
 void SelectElement::selectAll(SelectElementData& data, Element* element)
 {
     ASSERT(!data.usesMenuList());
@@ -561,10 +569,9 @@ void SelectElement::menuListDefaultEventHandler(SelectElementData& data, Element
 #else
         // When using spatial navigation, we want to be able to navigate away from the select element
         // when the user hits any of the arrow keys, instead of changing the selection.
-        if (Frame* frame = element->document()->frame()) {
-            if (frame->settings() && frame->settings()->isSpatialNavigationEnabled())
+        if (isSpatialNavigationEnabled(element->document()->frame()))
+            if (!data.activeSelectionState())
                 return;
-        }
 
         UNUSED_PARAM(htmlForm);
         const Vector<Element*>& listItems = data.listItems(element);
@@ -645,6 +652,10 @@ void SelectElement::menuListDefaultEventHandler(SelectElementData& data, Element
             // listIndex should already be selected, but this will fire the onchange handler.
             setSelectedIndex(data, element, listToOptionIndex(data, element, listIndex), true, true);
             handled = true;
+        } else if (keyCode == ' ' && isSpatialNavigationEnabled(element->document()->frame())) {
+            // Use space to trigger arrow key handling for selection change or spatial navigation.
+            data.setActiveSelectionState(!data.activeSelectionState());
+            handled = true;
         }
 #endif
         if (handled)
@@ -763,13 +774,10 @@ void SelectElement::listBoxDefaultEventHandler(SelectElementData& data, Element*
                 endIndex = previousSelectableListIndex(data, element, data.activeSelectionEndIndex());    
         }
 
-        if (Frame* frame = element->document()->frame()) {
-            if (frame->settings() && frame->settings()->isSpatialNavigationEnabled()) {
-                // Check if the selection moves to the boundary.
-                if (keyIdentifier == "Left" || keyIdentifier == "Right" || ((keyIdentifier == "Down" || keyIdentifier == "Up") && endIndex == data.activeSelectionEndIndex()))
-                    return;
-            }
-        }
+        if (isSpatialNavigationEnabled(element->document()->frame()))
+            // Check if the selection moves to the boundary.
+            if (keyIdentifier == "Left" || keyIdentifier == "Right" || ((keyIdentifier == "Down" || keyIdentifier == "Up") && endIndex == data.activeSelectionEndIndex()))
+                return;
 
         if (keyIdentifier == "Down" || keyIdentifier == "Up") {
             // Save the selection so it can be compared to the new selection when dispatching change events immediately after making the new selection.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list