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

Unified Diff: LayoutTests/fast/frames/frame-focus-send-blur.html

Issue 238023004: Focusing iframe window should trigger blur event for oldframe's focused element (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incorporated review comments Created 6 years, 8 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/frames/frame-focus-send-blur-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/frames/frame-focus-send-blur.html
diff --git a/LayoutTests/fast/frames/frame-focus-send-blur.html b/LayoutTests/fast/frames/frame-focus-send-blur.html
new file mode 100644
index 0000000000000000000000000000000000000000..e4b00d9025ae723bd634f06457af263acefd83a1
--- /dev/null
+++ b/LayoutTests/fast/frames/frame-focus-send-blur.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test.js"></script>
+<iframe id="frame1" src="data:text/html,<input id='input'>" ></iframe>
+<iframe id="frame2" src="data:text/html,<div>This is a iframe element</div>"></iframe>
+<script>
+description('Make sure that moving focus on an inactive frame fires blur event on existing element focus.');
+var doc;
+var input;
+window.onload = function()
+{
+ var frame1 = document.getElementById('frame1');
+ var frame2 = document.getElementById('frame2');
+
+ doc = frame1.contentDocument;
+ input = doc.querySelector('input');
+ input.onblur = function() {
+ testPassed('A blur event was dispatched on frame1 input element.');
+ }
+ input.onfocus = function() {
+ testPassed('A focus event was dispatched on frame1 input element.');
+ }
+ input.focus();
+
+ debug('===> Making a first frame with a focused element inactive by focus() for second frame.');
+ frame2.contentWindow.focus();
+ shouldBe('frame1.contentDocument.activeElement', 'input');
+ debug('===> Making the first frame active again by focus() for first frame.');
+ frame1.contentWindow.focus();
+ shouldBe('frame1.contentDocument.activeElement', 'input');
+}
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/frames/frame-focus-send-blur-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698