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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/components/widget-focus.html

Issue 2377193004: [DevTools] Rework some focus code. (Closed)
Patch Set: FocusRestorer Created 4 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/extensions/extensions-panel.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script> 3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script> 4 <script>
5 5
6 function test() 6 function test()
7 { 7 {
8 var outerInput = document.createElement("input"); 8 var outerInput = document.createElement("input");
9 WebInspector.inspectorView.element.appendChild(outerInput); 9 WebInspector.inspectorView.element.appendChild(outerInput);
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 widget3.focus(); 68 widget3.focus();
69 dumpFocus(); 69 dumpFocus();
70 70
71 mainWidget.focus(); 71 mainWidget.focus();
72 dumpFocus(); 72 dumpFocus();
73 73
74 InspectorTest.completeTest(); 74 InspectorTest.completeTest();
75 75
76 function dumpFocus() 76 function dumpFocus()
77 { 77 {
78 var focused = WebInspector.currentFocusElement(); 78 var focused = document.deepActiveElement();
79 if (focused === outerInput) { 79 if (focused === outerInput) {
80 InspectorTest.addResult("Outer Focused"); 80 InspectorTest.addResult("Outer Focused");
81 } else if (focused === input1) { 81 } else if (focused === input1) {
82 InspectorTest.addResult("Input1 Focused"); 82 InspectorTest.addResult("Input1 Focused");
83 } else if (focused === input2) { 83 } else if (focused === input2) {
84 InspectorTest.addResult("Input2 Focused"); 84 InspectorTest.addResult("Input2 Focused");
85 } else if (focused === input3) { 85 } else if (focused === input3) {
86 InspectorTest.addResult("Input3 Focused"); 86 InspectorTest.addResult("Input3 Focused");
87 } else if (focused === input4) { 87 } else if (focused === input4) {
88 InspectorTest.addResult("Input4 Focused"); 88 InspectorTest.addResult("Input4 Focused");
89 } else { 89 } else {
90 InspectorTest.addResult("No focus"); 90 InspectorTest.addResult("No focus");
91 } 91 }
92 } 92 }
93 } 93 }
94 </script> 94 </script>
95 </head> 95 </head>
96 <body onload="runTest()"> 96 <body onload="runTest()">
97 <p>Tests whether focus is properly remembered on widgets.</p> 97 <p>Tests whether focus is properly remembered on widgets.</p>
98 </body> 98 </body>
99 </html> 99 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/extensions/extensions-panel.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698