AX: the web area should report that focus can be set to itself
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Feb 2012 19:23:52 +0000 (19:23 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Feb 2012 19:23:52 +0000 (19:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=78272

Reviewed by Beth Dakin.

Source/WebCore:

Test: platform/mac/accessibility/webarea-can-set-focus.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::canSetFocusAttribute):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::isDataTable):
   Fixed erroneous comment.

LayoutTests:

* platform/mac/accessibility/webarea-can-set-focus-expected.txt: Added.
* platform/mac/accessibility/webarea-can-set-focus.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@107588 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/mac/accessibility/webarea-can-set-focus-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/accessibility/webarea-can-set-focus.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/AccessibilityTable.cpp

index 9ae4b0c..039fda5 100644 (file)
@@ -1,3 +1,13 @@
+2012-02-13  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: the web area should report that focus can be set to itself
+        https://bugs.webkit.org/show_bug.cgi?id=78272
+
+        Reviewed by Beth Dakin.
+
+        * platform/mac/accessibility/webarea-can-set-focus-expected.txt: Added.
+        * platform/mac/accessibility/webarea-can-set-focus.html: Added.
+
 2012-02-13  Tony Chang  <tony@chromium.org>
 
         [chromium] Unreviewed, update mac-snowleopard result.  This matches
diff --git a/LayoutTests/platform/mac/accessibility/webarea-can-set-focus-expected.txt b/LayoutTests/platform/mac/accessibility/webarea-can-set-focus-expected.txt
new file mode 100644 (file)
index 0000000..c81fc3f
--- /dev/null
@@ -0,0 +1,10 @@
+This tests that the web area's focus can be settable.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS body.isFocusable is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/mac/accessibility/webarea-can-set-focus.html b/LayoutTests/platform/mac/accessibility/webarea-can-set-focus.html
new file mode 100644 (file)
index 0000000..a9d9b02
--- /dev/null
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that the web area's focus can be settable.");
+
+    if (window.accessibilityController) {
+
+          var tree = document.getElementById("body");
+          body.focus();
+
+          // Test tree attributes.
+          body = accessibilityController.focusedElement;
+          shouldBe("body.isFocusable", "true");
+    }
+
+</script>
+
+<script src="../../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
index cca8fd3..e9577b6 100644 (file)
@@ -1,3 +1,18 @@
+2012-02-13  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: the web area should report that focus can be set to itself
+        https://bugs.webkit.org/show_bug.cgi?id=78272
+
+        Reviewed by Beth Dakin.
+
+        Test: platform/mac/accessibility/webarea-can-set-focus.html
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::canSetFocusAttribute):
+        * accessibility/AccessibilityTable.cpp:
+        (WebCore::AccessibilityTable::isDataTable):
+           Fixed erroneous comment.
+
 2012-02-13  Patrick Gansterer  <paroga@webkit.org>
 
         Port RunLoop to WinCE
index 0d9094a..8799346 100644 (file)
@@ -3348,6 +3348,9 @@ bool AccessibilityRenderObject::canSetFocusAttribute() const
 {
     Node* node = this->node();
 
+    if (isWebArea())
+        return true;
+    
     // NOTE: It would be more accurate to ask the document whether setFocusedNode() would
     // do anything.  For example, setFocusedNode() will do nothing if the current focused
     // node will not relinquish the focus.
index 8e1ef7a..56ef47b 100644 (file)
@@ -170,7 +170,7 @@ bool AccessibilityTable::isDataTable() const
             if (!row && isTHCell)
                 headersInFirstRowCount++;
 
-            // If the first column is comprised of all <tg> tags, assume it is a data table.
+            // If the first column is comprised of all <th> tags, assume it is a data table.
             if (!col && isTHCell)
                 headersInFirstColumnCount++;