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

Unified Diff: LayoutTests/fast/events/focus-click-on-non-mouse-focusable-element.html

Issue 20670002: REGRESSION: Click on focused link should not remove focus on it. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: typo Created 7 years, 5 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/focus-click-on-non-mouse-focusable-element-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/events/focus-click-on-non-mouse-focusable-element.html
diff --git a/LayoutTests/fast/events/focus-click-on-non-mouse-focusable-element.html b/LayoutTests/fast/events/focus-click-on-non-mouse-focusable-element.html
new file mode 100644
index 0000000000000000000000000000000000000000..205369593535ee1c4f70156d964f017087fe44e9
--- /dev/null
+++ b/LayoutTests/fast/events/focus-click-on-non-mouse-focusable-element.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<body>
+<a href="#foo" onclick="return false;">link</a>
+<input>
+<script src="../js/resources/js-test-pre.js"></script>
+<script>
+description('Click on a focused anchor element should not change focus, and click on a non-focused anchor element should remove focus of another element.');
+jsTestIsAsync = true;
+var a = document.querySelector('a');
+var input = document.querySelector('input');
+window.onload = function() {
+ a.focus();
+ shouldBe('document.activeElement', 'a', true);
+ eventSender.mouseMoveTo(a.offsetLeft + a.offsetWidth / 2, a.offsetTop + a.offsetHeight / 2);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ shouldBe('document.activeElement', 'a');
+
+ input.focus();
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ shouldBe('document.activeElement', 'document.body');
+
+ finishJSTest();
+};
+</script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
« no previous file with comments | « no previous file | LayoutTests/fast/events/focus-click-on-non-mouse-focusable-element-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698