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

Unified Diff: LayoutTests/fast/events/press-enter-key-on-focused-element-inside-link.html

Issue 619613005: The link should be activated by enter key on focusing the child element inside the anchor(relanding) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 1 month 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/press-enter-key-on-focused-element-inside-link-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/events/press-enter-key-on-focused-element-inside-link.html
diff --git a/LayoutTests/fast/events/press-enter-key-on-focused-element-inside-link.html b/LayoutTests/fast/events/press-enter-key-on-focused-element-inside-link.html
new file mode 100644
index 0000000000000000000000000000000000000000..3e5bbcb56899fe36a7101b6a57c85f6f526b331a
--- /dev/null
+++ b/LayoutTests/fast/events/press-enter-key-on-focused-element-inside-link.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<script src="../../resources/js-test.js"></script>
+<a id="link" href="#" tabindex="-1" onclick="debug(eventInfo(event))">
+ <h1 tabindex="1" id="focus0"
+ onkeydown="debug(eventInfo(event))"
+ onkeypress="debug(eventInfo(event))"
+ onkeyup="debug(eventInfo(event))">EnterMe</h1>
+ <textarea tabindex="2" id="focus1"
+ onkeydown="debug(eventInfo(event))"
+ onkeypress="debug(eventInfo(event))"
+ onkeyup="debug(eventInfo(event))">TypeHere</textarea>
+</a>
+<svg width="200" height="50" onclick="debug(eventInfo(event))">
+ <a xlink:href="#">
+ <text font-size="18px" y="20" tabindex="3"
+ onkeydown="debug(eventInfo(event))"
+ onkeypress="debug(eventInfo(event))"
+ onkeyup="debug(eventInfo(event))">SVG anchor with tabindex</text>
+ </a>
+</svg>
+<div id="console"></div>
+<script>
+ description('This test ensures that the link is activated by enter key on focusing the child element inside the anchor');
+ function eventInfo(event) {
+ if (event.type == 'keydown' || event.type == 'keypress' || event.type == 'keyup')
+ return event.keyIdentifier == 'U+0009' ? '' : event.target.tagName + ' - ' + event.type + ' - ' + event.keyIdentifier;
+ else if (event.type == 'click')
+ return event.target.tagName + ' - ' + event.type;
+ else
+ return 'unexpected event - ' + event.target.tagName + ' - ' + event.type;
+
+ }
+ for (var i = 0; i < 3; i++) {
+ if (window.eventSender) {
+ eventSender.keyDown('\t');
+ eventSender.keyDown('\n');
+ }
+ }
+
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/events/press-enter-key-on-focused-element-inside-link-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698