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

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: Actually add new test 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..4b95fa67c1030aedf1593a65edb2204d7e68ca82
--- /dev/null
+++ b/LayoutTests/fast/events/tab-focus-anchor-tab-to-links.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+
+function pass()
dmazzoni 2013/09/10 21:35:47 One last thing - since this is a new test it'd be
+{
+ var el = document.querySelector('pre');
+ el.textContent += 'PASS\n';
+}
+
+function fail()
+{
+ var el = document.querySelector('pre');
+ el.textContent += 'FAIL\n';
+}
+
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.overridePreference('WebKitTabToLinksPreferenceKey', true);
+}
+
+window.onload = function()
+{
+ if (!window.testRunner)
+ return;
+
+ for (var i = 0; i < 3; i++) {
+ eventSender.keyDown('\t');
+ }
+};
+
+</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="pass()" href="#">Focusable</a></p>
+<p><a onfocus="fail()">Not focusable</a></p>
+<p><a tabindex=0 onfocus="pass()" href="#">Focusable</a></p>
+<p><a tabindex=0 onfocus="pass()">Focusable</a></p>
+<p><input onfocus="fail()"></p>
+
+<p>Result
+
+<pre id="out"></pre>
+
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698