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

Side by Side Diff: LayoutTests/fast/events/frame-tab-focus.html

Issue 1234613004: Only execute default actions on trusted events. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master_event_trusted_main3
Patch Set: Rebase Created 5 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 unified diff | Download patch
OLDNEW
1 <html> 1 <html>
2 <style> 2 <style>
3 body { 3 body {
4 background-color: white; 4 background-color: white;
5 } 5 }
6 6
7 iframe { 7 iframe {
8 border: 2px solid black; 8 border: 2px solid black;
9 } 9 }
10 </style> 10 </style>
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 win.setupWindow = setupWindow; 80 win.setupWindow = setupWindow;
81 win.setupBody = setupBodyFunc(win, name); 81 win.setupBody = setupBodyFunc(win, name);
82 82
83 win.onfocus = windowFocused(win, name); 83 win.onfocus = windowFocused(win, name);
84 win.onblur = windowBlurred(win, name); 84 win.onblur = windowBlurred(win, name);
85 } 85 }
86 86
87 function dispatchTabPress(element, shiftKey, altKey) 87 function dispatchTabPress(element, shiftKey, altKey)
88 { 88 {
89 var event = document.createEvent('KeyboardEvents'); 89 if (window.testRunner) {
90 var tabKeyIdentifier = 'U+0009'; 90 modifiers = [];
91 event.initKeyboardEvent('keydown', true, true, document.defaultView, tabKeyI dentifier, 0, false, altKey, shiftKey, false, false); 91 if (shiftKey)
92 element.dispatchEvent(event); 92 modifiers[0] = "shiftKey";
tkent 2015/07/22 23:15:03 modifieers.push("shiftKey") would be simpler.
dtapuska 2015/07/23 01:28:10 Done.
93 if (altKey)
94 modifiers[modifiers.length] = "altKey";
tkent 2015/07/22 23:15:03 modifiers.push("altKey") is simpler.
dtapuska 2015/07/23 01:28:10 Done.
95 eventSender.keyDown('\u0009', modifiers);
96 }
93 } 97 }
94 98
95 function test() 99 function test()
96 { 100 {
97 if (window.testRunner) { 101 if (window.testRunner) {
98 testRunner.dumpAsText(); 102 testRunner.dumpAsText();
99 } 103 }
100 104
101 log('Tabbing forward...\n'); 105 log('Tabbing forward...\n');
102 document.getElementById('first').focus(); 106 document.getElementById('first').focus();
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 <iframe id="upper" src="resources/frame-tab-focus-upper.html" height="300">< /iframe> 150 <iframe id="upper" src="resources/frame-tab-focus-upper.html" height="300">< /iframe>
147 <iframe id="child" tabindex="4" src="resources/frame-tab-focus-child.html">< /iframe> 151 <iframe id="child" tabindex="4" src="resources/frame-tab-focus-child.html">< /iframe>
148 <input type="text"> 152 <input type="text">
149 <a tabindex="1" href="#">[tabindex of one]</a> 153 <a tabindex="1" href="#">[tabindex of one]</a>
150 <a tabindex="3" href="#">[tabindex of three]</a> 154 <a tabindex="3" href="#">[tabindex of three]</a>
151 <a tabindex="2" href="#">[tabindex of two]</a> 155 <a tabindex="2" href="#">[tabindex of two]</a>
152 <a tabindex="3" href="#">[tabindex of three]</a> 156 <a tabindex="3" href="#">[tabindex of three]</a>
153 <pre id="log"></pre> 157 <pre id="log"></pre>
154 </body> 158 </body>
155 </html> 159 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698