Title: [126908] trunk
Revision
126908
Author
[email protected]
Date
2012-08-28 12:05:43 -0700 (Tue, 28 Aug 2012)

Log Message

AX: Should be able to tab to focus a link in a canvas subtree
https://bugs.webkit.org/show_bug.cgi?id=94967

Reviewed by Chris Fleizach.

Source/WebCore:

Skips the hasNonEmptyBoundingBox check in isKeyboardFocusable
when in a canvas subtree.

Test: fast/events/tab-focus-link-in-canvas.html

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::isKeyboardFocusable):

LayoutTests:

Adds a test to make sure you can tab to a link inside a canvas
subtree.

* fast/events/tab-focus-link-in-canvas-expected.txt: Added.
* fast/events/tab-focus-link-in-canvas.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (126907 => 126908)


--- trunk/LayoutTests/ChangeLog	2012-08-28 18:52:17 UTC (rev 126907)
+++ trunk/LayoutTests/ChangeLog	2012-08-28 19:05:43 UTC (rev 126908)
@@ -1,3 +1,16 @@
+2012-08-28  Dominic Mazzoni  <[email protected]>
+
+        AX: Should be able to tab to focus a link in a canvas subtree
+        https://bugs.webkit.org/show_bug.cgi?id=94967
+
+        Reviewed by Chris Fleizach.
+
+        Adds a test to make sure you can tab to a link inside a canvas
+        subtree.
+
+        * fast/events/tab-focus-link-in-canvas-expected.txt: Added.
+        * fast/events/tab-focus-link-in-canvas.html: Added.
+
 2012-08-28  Philip Rogers  <[email protected]>
 
         Rebaselining chromium-mac test results with scrollbars.

Added: trunk/LayoutTests/fast/events/tab-focus-link-in-canvas-expected.txt (0 => 126908)


--- trunk/LayoutTests/fast/events/tab-focus-link-in-canvas-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/events/tab-focus-link-in-canvas-expected.txt	2012-08-28 19:05:43 UTC (rev 126908)
@@ -0,0 +1,11 @@
+Ensures that you can tab to focus a link inside a canvas subtree.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.activeElement.id is "before"
+PASS document.activeElement.id is "canvas_link"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+Before 

Added: trunk/LayoutTests/fast/events/tab-focus-link-in-canvas.html (0 => 126908)


--- trunk/LayoutTests/fast/events/tab-focus-link-in-canvas.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/tab-focus-link-in-canvas.html	2012-08-28 19:05:43 UTC (rev 126908)
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body>
+
+<a id="before" href=""
+
+<canvas>
+  <a id="canvas_link" href="" Link</a>
+</canvas>
+
+<script>
+description("Ensures that you can tab to focus a link inside a canvas subtree.");
+
+if (window.testRunner && window.eventSender) {
+    testRunner.dumpAsText();
+    testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
+
+    document.getElementById('before').focus();
+    shouldBe('document.activeElement.id', '"before"');
+
+    eventSender.keyDown('\t');
+    shouldBe('document.activeElement.id', '"canvas_link"');
+}
+
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (126907 => 126908)


--- trunk/Source/WebCore/ChangeLog	2012-08-28 18:52:17 UTC (rev 126907)
+++ trunk/Source/WebCore/ChangeLog	2012-08-28 19:05:43 UTC (rev 126908)
@@ -1,3 +1,18 @@
+2012-08-28  Dominic Mazzoni  <[email protected]>
+
+        AX: Should be able to tab to focus a link in a canvas subtree
+        https://bugs.webkit.org/show_bug.cgi?id=94967
+
+        Reviewed by Chris Fleizach.
+
+        Skips the hasNonEmptyBoundingBox check in isKeyboardFocusable
+        when in a canvas subtree.
+
+        Test: fast/events/tab-focus-link-in-canvas.html
+
+        * html/HTMLAnchorElement.cpp:
+        (WebCore::HTMLAnchorElement::isKeyboardFocusable):
+
 2012-08-28  Koji Ishii  <[email protected]>
 
         OPENTYPE_VERTICAL support for Chromium Win

Modified: trunk/Source/WebCore/html/HTMLAnchorElement.cpp (126907 => 126908)


--- trunk/Source/WebCore/html/HTMLAnchorElement.cpp	2012-08-28 18:52:17 UTC (rev 126907)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.cpp	2012-08-28 19:05:43 UTC (rev 126908)
@@ -114,6 +114,9 @@
     if (!document()->frame()->eventHandler()->tabsToLinks(event))
         return false;
 
+    if (isInCanvasSubtree())
+        return true;
+
     return hasNonEmptyBoundingBox();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to