AX: click point for AXHeadings often returns point on empty space (results in wrong...
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Oct 2011 18:09:28 +0000 (18:09 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Oct 2011 18:09:28 +0000 (18:09 +0000)
https://bugs.webkit.org/show_bug.cgi?id=69262

Actually commit the files this time.

Reviewed by John Sullivan.

* platform/mac/accessibility/heading-clickpoint-expected.txt: Added.
* platform/mac/accessibility/heading-clickpoint.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/platform/mac/accessibility/heading-clickpoint-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/accessibility/heading-clickpoint.html [new file with mode: 0644]

index cc13d4b..e7868e9 100644 (file)
@@ -1,3 +1,15 @@
+2011-10-03  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: click point for AXHeadings often returns point on empty space (results in wrong context menu)
+        https://bugs.webkit.org/show_bug.cgi?id=69262
+
+        Actually commit the files this time.
+
+        Reviewed by John Sullivan.
+
+        * platform/mac/accessibility/heading-clickpoint-expected.txt: Added.
+        * platform/mac/accessibility/heading-clickpoint.html: Added.
+
 2011-10-03  Adam Barth  <abarth@webkit.org>
 
         Results from more bots for http://trac.webkit.org/changeset/96498.
diff --git a/LayoutTests/platform/mac/accessibility/heading-clickpoint-expected.txt b/LayoutTests/platform/mac/accessibility/heading-clickpoint-expected.txt
new file mode 100644 (file)
index 0000000..954a505
--- /dev/null
@@ -0,0 +1,20 @@
+Small heading
+
+A heading that is just a little bit wider
+
+Small heading Small heading
+
+This tests that the click points for headings should use the only child's clickpoint instead of taking the mid point (which may be on nothing).
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS heading1.clickPointX is heading1.childAtIndex(0).clickPointX
+PASS heading1.clickPointY is heading1.childAtIndex(0).clickPointY
+PASS heading2.clickPointX is heading2.childAtIndex(0).clickPointX
+PASS heading2.clickPointY is heading2.childAtIndex(0).clickPointY
+PASS heading3.clickPointX == heading3.childAtIndex(0).clickPointX is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/mac/accessibility/heading-clickpoint.html b/LayoutTests/platform/mac/accessibility/heading-clickpoint.html
new file mode 100644 (file)
index 0000000..84cd009
--- /dev/null
@@ -0,0 +1,52 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script>
+var successfullyParsed = false;
+</script>
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+
+<h1 tabindex="0" id="heading1">Small heading</h1>
+<h1 tabindex="0" id="heading2"><a href="#">A heading that is just a little bit wider</a></h1>
+
+<h1 tabindex="0" id="heading3"><a href="#">Small heading</a> <a href="#">Small heading</a></h1>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that the click points for headings should use the only child's clickpoint instead of taking the mid point (which may be on nothing).");
+
+    if (window.accessibilityController) {
+
+        document.getElementById("heading1").focus();
+        var heading1 = accessibilityController.focusedElement;
+
+        // Verify that the click point is the same as the child.
+        shouldBe("heading1.clickPointX", "heading1.childAtIndex(0).clickPointX");
+        shouldBe("heading1.clickPointY", "heading1.childAtIndex(0).clickPointY");
+
+        document.getElementById("heading2").focus();
+        var heading2 = accessibilityController.focusedElement;
+
+        shouldBe("heading2.clickPointX", "heading2.childAtIndex(0).clickPointX");
+        shouldBe("heading2.clickPointY", "heading2.childAtIndex(0).clickPointY");
+
+        document.getElementById("heading3").focus();
+        var heading3 = accessibilityController.focusedElement;
+
+        // If there is more than one child, the click point should be the middle again, which means X point will be different.
+        shouldBeFalse("heading3.clickPointX == heading3.childAtIndex(0).clickPointX");
+
+    }
+
+    successfullyParsed = true;
+</script>
+
+<script src="../../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>