[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
yael.aharon at nokia.com
yael.aharon at nokia.com
Wed Dec 22 14:09:00 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit c3345a675534843573447076ae731eca195dc6ae
Author: yael.aharon at nokia.com <yael.aharon at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Oct 5 04:28:54 2010 +0000
2010-10-04 Yael Aharon <yael.aharon at nokia.com>
Reviewed by Antonio Gomes.
Spatial Navigation: select element does not release focus with Spatial Navigation
https://bugs.webkit.org/show_bug.cgi?id=46896
* fast/events/spatial-navigation/snav-multiple-select-expected.txt: Added.
* fast/events/spatial-navigation/snav-multiple-select.html: Added.
* fast/events/spatial-navigation/snav-single-select-expected.txt: Added.
* fast/events/spatial-navigation/snav-single-select.html: Added.
2010-10-04 Yael Aharon <yael.aharon at nokia.com>
Reviewed by Antonio Gomes.
Spatial Navigation: select element does not release focus with Spatial Navigation
https://bugs.webkit.org/show_bug.cgi?id=46896
When using Spatial Navigation, once a select element is focused, you cannot use arrow keys
to navigate out of the select element. That is because select element currently uses the
arrow keys to change the selected element.
Change the behavior of select element so it does not change selection, if Spatial Navigation
is on.
This patch is addressing the case where Spatial Navigation is used
in a mobile device, and the flag ENABLE_NO_LISTBOX_RENDERING is on.
In the future we can add support for the case where the flag is off, and
the user needs to traverse the select element inline.
Tests: fast/events/spatial-navigation/snav-multiple-select.html
fast/events/spatial-navigation/snav-single-select.html
* dom/SelectElement.cpp:
(WebCore::SelectElement::menuListDefaultEventHandler):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69068 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index bb919b9..1a2d187 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-10-04 Yael Aharon <yael.aharon at nokia.com>
+
+ Reviewed by Antonio Gomes.
+
+ Spatial Navigation: select element does not release focus with Spatial Navigation
+ https://bugs.webkit.org/show_bug.cgi?id=46896
+
+ * fast/events/spatial-navigation/snav-multiple-select-expected.txt: Added.
+ * fast/events/spatial-navigation/snav-multiple-select.html: Added.
+ * fast/events/spatial-navigation/snav-single-select-expected.txt: Added.
+ * fast/events/spatial-navigation/snav-single-select.html: Added.
+
2010-10-04 Chang Shu <chang.shu at nokia.com>
Reviewed by Antonio Gomes.
diff --git a/LayoutTests/fast/events/spatial-navigation/snav-multiple-select-expected.txt b/LayoutTests/fast/events/spatial-navigation/snav-multiple-select-expected.txt
new file mode 100644
index 0000000..be55150
--- /dev/null
+++ b/LayoutTests/fast/events/spatial-navigation/snav-multiple-select-expected.txt
@@ -0,0 +1,12 @@
+2
+4 6
+8
+PASS gFocusedDocument.activeElement.getAttribute("id") is "8"
+PASS gFocusedDocument.activeElement.getAttribute("id") is "start"
+PASS gFocusedDocument.activeElement.getAttribute("id") is "2"
+PASS gFocusedDocument.activeElement.getAttribute("id") is "start"
+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"
+
diff --git a/LayoutTests/fast/events/spatial-navigation/snav-multiple-select.html b/LayoutTests/fast/events/spatial-navigation/snav-multiple-select.html
new file mode 100644
index 0000000..36c5295
--- /dev/null
+++ b/LayoutTests/fast/events/spatial-navigation/snav-multiple-select.html
@@ -0,0 +1,78 @@
+<html>
+ <!--
+ This test ensures the correctness of Spatial Navigation (SNav) algorithm over single select element.
+
+ * Pre-conditions:
+ 1) DRT support for SNav enable/disable.
+
+ * Navigation steps:
+ 1) Loads this page, focus goes to "start" automatically.
+ 2) Focus moves away from select in 4 different directions to neighbor nodes and back.
+ -->
+ <head>
+ <script src="../../js/resources/js-test-pre.js"></script>
+ <script src="resources/spatial-navigation-utils.js"></script>
+ <script type="application/javascript">
+
+ var resultMap = [
+ ["Down", "8"],
+ ["Up", "start"],
+ ["Up", "2"],
+ ["Down", "start"],
+ ["Right", "6"],
+ ["Left", "start"],
+ ["Left", "4"],
+ ["Right", "start"],
+ ["DONE", "DONE"]
+ ];
+
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.setSpatialNavigationEnabled(true);
+ layoutTestController.overridePreference("WebKitTabToLinksPreferenceKey", 1);
+ layoutTestController.waitUntilDone();
+ }
+
+ function runTest()
+ {
+ // starting the test itself: get to a known place.
+ document.getElementById("start").focus();
+
+ initTest(resultMap, testCompleted);
+ }
+
+ function testCompleted()
+ {
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }
+
+ window.onload = runTest;
+
+ </script>
+ <script src="../js/resources/js-test-post.js"></script>
+ </head>
+ <body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
+ <table style="text-align: left; width: 100%; margin-left: auto; margin-right: auto;" border="1" cellpadding="2" cellspacing="1">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top; text-align: center;"></td>
+ <td style="vertical-align: top; text-align: center;"><a id="2" href="a">2</a></td>
+ <td style="vertical-align: top; text-align: center;"></td>
+ </tr>
+ <tr>
+ <td style="vertical-align: top; text-align: center;"><a id="4" href="a">4</a></td>
+ <td style="vertical-align: top; text-align: center;"><select id="start" multiple><option>1</option><option>2</option><option>3</option></select></td>
+ <td style="vertical-align: top; text-align: center;"><a id="6" href="a">6</a></td>
+ </tr>
+ <tr>
+ <td style="vertical-align: top; text-align: center;"></td>
+ <td style="vertical-align: top; text-align: center;"><a id="8" href="a">8</a></td>
+ <td style="vertical-align: top; text-align: center;"></td>
+ </tr>
+ </tbody>
+ </table>
+ <div id="console"></div>
+ </body>
+</html>
+
diff --git a/LayoutTests/fast/events/spatial-navigation/snav-single-select-expected.txt b/LayoutTests/fast/events/spatial-navigation/snav-single-select-expected.txt
new file mode 100644
index 0000000..be55150
--- /dev/null
+++ b/LayoutTests/fast/events/spatial-navigation/snav-single-select-expected.txt
@@ -0,0 +1,12 @@
+2
+4 6
+8
+PASS gFocusedDocument.activeElement.getAttribute("id") is "8"
+PASS gFocusedDocument.activeElement.getAttribute("id") is "start"
+PASS gFocusedDocument.activeElement.getAttribute("id") is "2"
+PASS gFocusedDocument.activeElement.getAttribute("id") is "start"
+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"
+
diff --git a/LayoutTests/fast/events/spatial-navigation/snav-single-select.html b/LayoutTests/fast/events/spatial-navigation/snav-single-select.html
new file mode 100644
index 0000000..fa7e269
--- /dev/null
+++ b/LayoutTests/fast/events/spatial-navigation/snav-single-select.html
@@ -0,0 +1,78 @@
+<html>
+ <!--
+ This test ensures the correctness of Spatial Navigation (SNav) algorithm over single select element.
+
+ * Pre-conditions:
+ 1) DRT support for SNav enable/disable.
+
+ * Navigation steps:
+ 1) Loads this page, focus goes to "start" automatically.
+ 2) Focus moves away from select in 4 different directions to neighbor nodes and back.
+ -->
+ <head>
+ <script src="../../js/resources/js-test-pre.js"></script>
+ <script src="resources/spatial-navigation-utils.js"></script>
+ <script type="application/javascript">
+
+ var resultMap = [
+ ["Down", "8"],
+ ["Up", "start"],
+ ["Up", "2"],
+ ["Down", "start"],
+ ["Right", "6"],
+ ["Left", "start"],
+ ["Left", "4"],
+ ["Right", "start"],
+ ["DONE", "DONE"]
+ ];
+
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.setSpatialNavigationEnabled(true);
+ layoutTestController.overridePreference("WebKitTabToLinksPreferenceKey", 1);
+ layoutTestController.waitUntilDone();
+ }
+
+ function runTest()
+ {
+ // starting the test itself: get to a known place.
+ document.getElementById("start").focus();
+
+ initTest(resultMap, testCompleted);
+ }
+
+ function testCompleted()
+ {
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }
+
+ window.onload = runTest;
+
+ </script>
+ <script src="../js/resources/js-test-post.js"></script>
+ </head>
+ <body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
+ <table style="text-align: left; width: 100%; margin-left: auto; margin-right: auto;" border="1" cellpadding="2" cellspacing="1">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top; text-align: center;"></td>
+ <td style="vertical-align: top; text-align: center;"><a id="2" href="a">2</a></td>
+ <td style="vertical-align: top; text-align: center;"></td>
+ </tr>
+ <tr>
+ <td style="vertical-align: top; text-align: center;"><a id="4" href="a">4</a></td>
+ <td style="vertical-align: top; text-align: center;"><select id="start"><option>1</option><option>2</option><option>3</option></select></td>
+ <td style="vertical-align: top; text-align: center;"><a id="6" href="a">6</a></td>
+ </tr>
+ <tr>
+ <td style="vertical-align: top; text-align: center;"></td>
+ <td style="vertical-align: top; text-align: center;"><a id="8" href="a">8</a></td>
+ <td style="vertical-align: top; text-align: center;"></td>
+ </tr>
+ </tbody>
+ </table>
+ <div id="console"></div>
+ </body>
+</html>
+
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 63ff6e7..1bee063 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,27 @@
+2010-10-04 Yael Aharon <yael.aharon at nokia.com>
+
+ Reviewed by Antonio Gomes.
+
+ Spatial Navigation: select element does not release focus with Spatial Navigation
+ https://bugs.webkit.org/show_bug.cgi?id=46896
+
+ When using Spatial Navigation, once a select element is focused, you cannot use arrow keys
+ to navigate out of the select element. That is because select element currently uses the
+ arrow keys to change the selected element.
+ Change the behavior of select element so it does not change selection, if Spatial Navigation
+ is on.
+
+ This patch is addressing the case where Spatial Navigation is used
+ in a mobile device, and the flag ENABLE_NO_LISTBOX_RENDERING is on.
+ In the future we can add support for the case where the flag is off, and
+ the user needs to traverse the select element inline.
+
+ Tests: fast/events/spatial-navigation/snav-multiple-select.html
+ fast/events/spatial-navigation/snav-single-select.html
+
+ * dom/SelectElement.cpp:
+ (WebCore::SelectElement::menuListDefaultEventHandler):
+
2010-10-04 Sriram Neelakandan <sriram.neelakandan at gmail.com>
Reviewed by Andreas Kling.
diff --git a/WebCore/dom/SelectElement.cpp b/WebCore/dom/SelectElement.cpp
index bcab08c..024ba7a 100644
--- a/WebCore/dom/SelectElement.cpp
+++ b/WebCore/dom/SelectElement.cpp
@@ -41,6 +41,7 @@
#include "Page.h"
#include "RenderListBox.h"
#include "RenderMenuList.h"
+#include "Settings.h"
#include <wtf/Assertions.h>
#if ENABLE(WML)
@@ -554,6 +555,13 @@ void SelectElement::menuListDefaultEventHandler(SelectElementData& data, Element
handled = true;
}
#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())
+ return;
+ }
+
UNUSED_PARAM(htmlForm);
const Vector<Element*>& listItems = data.listItems(element);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list