Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Unified Diff: LayoutTests/fast/events/tab-focus-anchor-tab-to-links.html

Issue 15238002: Disallow tabsToLinks setting to prevent tabbing to anchor with tabIndex. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: And update expected result after removing accidentally added line Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/events/tab-focus-anchor-tab-to-links.html
diff --git a/LayoutTests/fast/events/tab-focus-anchor-tab-to-links.html b/LayoutTests/fast/events/tab-focus-anchor-tab-to-links.html
new file mode 100644
index 0000000000000000000000000000000000000000..4a12f08cd3508813646c3288e3f56eb1529c69d9
--- /dev/null
+++ b/LayoutTests/fast/events/tab-focus-anchor-tab-to-links.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="help" href="http://www.w3.org/TR/DOM-Level-3-Events/#events-WheelEvent">
+<script src="../js/resources/js-test-pre.js"></script>
+<script>
+function runTest()
+{
+ if (!window.testRunner || !window.eventSender) {
+ debug("FAIL: This test requires window.testRunner and window.eventSender.");
+ finishJSTest();
+ return;
+ }
+
+ testRunner.overridePreference('WebKitTabToLinksPreferenceKey', true);
+
+ for (var i = 0; i < 3; i++)
+ eventSender.keyDown('\t');
+
+ finishJSTest();
+};
+
+window.addEventListener('load', runTest);
+</script>
+</head>
+<body>
+
+<p>This test ensures that we can tab to all anchor elements. Press tab three
+times to focus the elements below.
+
+<p><a onfocus="testPassed('gave focus to focusable element')" href="#">Focusable</a></p>
+<p><a onfocus="testFailed('gave focus to unfocusable element')">Not focusable</a></p>
+<p><a tabindex=0 onfocus="testPassed('gave focus to focusable element')" href="#">Focusable</a></p>
+<p><a tabindex=0 onfocus="testPassed('gave focus to focusable element')">Focusable</a></p>
+<p><input onfocus="testFailed('should have stopped testing before this element')"></p>
+
+<p>Result
+
+<div id="console"></div>
+
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698