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

Unified Diff: LayoutTests/fast/events/anchor-empty-focus.html

Issue 23496036: Make it possible to focus on 0-size form controls and anchors. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
« no previous file with comments | « no previous file | LayoutTests/fast/events/anchor-empty-focus-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/events/anchor-empty-focus.html
diff --git a/LayoutTests/fast/events/anchor-empty-focus.html b/LayoutTests/fast/events/anchor-empty-focus.html
index 9436397749fa5685bf609c83b8dc74c47b4044b8..7692577421efc17108c92a97782d68c4844387d8 100644
--- a/LayoutTests/fast/events/anchor-empty-focus.html
+++ b/LayoutTests/fast/events/anchor-empty-focus.html
@@ -1,20 +1,27 @@
<html>
- <head>
- <script>
- function test()
- {
- document.getElementById("anch").focus();
- if (window.testRunner) {
- testRunner.dumpAsText();
- eventSender.keyDown('s');
- }
- }
- </script>
- </head>
- <body onload="test()">
- This tests that focus() works on an empty anchor.<br>
- <a id="anch" href="#" onkeydown="document.getElementById('console').innerText = 'TEST PASSED'"></a>
- <br>
- <pre id="console">TEST FAILED</pre>
- </body>
+<head>
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body onload="test()">
+<a id="anch" href="#"></a>
+<a id="anch2" href="#"></a>
+<input>
+
+<script>
+description('This tests that focus() and sequential focus navigation work on empty anchors.');
+jsTestIsAsync = true;
+var emptyAnchor1 = document.getElementById("anch");
+var emptyAnchor2 = document.getElementById("anch2");
+function test() {
+ emptyAnchor1.focus();
+ shouldBe('document.activeElement', 'emptyAnchor1');
+
+ testRunner.overridePreference('WebKitTabToLinksPreferenceKey', true);
+ eventSender.keyDown('\t');
+ shouldBe('document.activeElement', 'emptyAnchor2');
+ finishJSTest();
+}
+</script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
</html>
« no previous file with comments | « no previous file | LayoutTests/fast/events/anchor-empty-focus-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698