| OLD | NEW |
| 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 Loading... |
| 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> |
| OLD | NEW |