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

Unified Diff: LayoutTests/fast/events/frame-click-clear-focus.html

Issue 57813008: Clicking a non-focusable element in an inactive frame should clear focus in the frame. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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/frame-click-clear-focus-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/events/frame-click-clear-focus.html
diff --git a/LayoutTests/fast/events/frame-click-clear-focus.html b/LayoutTests/fast/events/frame-click-clear-focus.html
new file mode 100644
index 0000000000000000000000000000000000000000..5cac5cf854103e8ca3fadaf457b17f50db2f5111
--- /dev/null
+++ b/LayoutTests/fast/events/frame-click-clear-focus.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test.js"></script>
+<iframe id="frame1" src="data:text/html,<input>" width="800" height="600"></iframe>
+<iframe id="frame2" src="data:text/html,<input>" width="800" height="600"></iframe>
+<script>
+description('Make sure that clicking on an inactive frame clears existing element focus.');
+jsTestIsAsync = true;
+var doc;
+var innerInput;
+window.onload = function() {
+ doc = window.frames['frame1'].document;
+ innerInput = doc.querySelector('input');
+ innerInput.focus();
+ debug('===> Making a frame with a focused element inactive.');
+ window.frames['frame2'].focus();
+ // The following check is not important. activeElement is innerInput in IE,
+ // and is body in Firefox in this case.
+ shouldBe('doc.activeElement', 'innerInput');
+
+ debug('===> Making the frame active again clicking by a non-focusable element.');
+ var iframe1 = document.getElementById('frame1');
+ eventSender.mouseMoveTo(iframe1.offsetLeft + iframe1.offsetWidth / 2, iframe1.offsetTop + iframe1.offsetHeight / 2);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ shouldBe('doc.activeElement', 'doc.body');
+ finishJSTest();
+};
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/events/frame-click-clear-focus-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698