| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <style> | |
| 4 #input:focus { | |
| 5 color: green; | |
| 6 } | |
| 7 </style> | |
| 8 <script src="../../http/tests/inspector/inspector-test.js"></script> | |
| 9 <script> | |
| 10 | |
| 11 function focus() | |
| 12 { | |
| 13 document.getElementById("input").focus(); | |
| 14 document.width; | |
| 15 } | |
| 16 | |
| 17 function test() | |
| 18 { | |
| 19 CSSAgent.startSelectorProfiler(); | |
| 20 InspectorTest.evaluateInPage("focus()", step1); | |
| 21 | |
| 22 function step1() | |
| 23 { | |
| 24 CSSAgent.stopSelectorProfiler(step2); | |
| 25 } | |
| 26 | |
| 27 function step2(error, profile) | |
| 28 { | |
| 29 if (error) { | |
| 30 InspectorTest.addResult(error); | |
| 31 InspectorTest.completeTest(); | |
| 32 return; | |
| 33 } | |
| 34 | |
| 35 const selector = "#input:focus"; | |
| 36 for (var i = 0; i < profile.data.length; ++i) { | |
| 37 var entry = profile.data[i]; | |
| 38 if (entry.selector === selector) { | |
| 39 var segments = entry.url.split("/"); | |
| 40 var url = "<empty>"; | |
| 41 if (segments.length > 3) { | |
| 42 segments.splice(0, segments.length - 3); | |
| 43 url = segments.join("/"); | |
| 44 } | |
| 45 InspectorTest.addResult(selector + " stylesheet URL: " + url); | |
| 46 break; | |
| 47 } | |
| 48 } | |
| 49 InspectorTest.completeTest(); | |
| 50 } | |
| 51 } | |
| 52 | |
| 53 </script> | |
| 54 </head> | |
| 55 | |
| 56 <body onload="runTest()"> | |
| 57 <p> | |
| 58 Tests that CSS selector profile entries contain valid stylesheet URLs. <a href="
https://bugs.webkit.org/show_bug.cgi?id=104225">Bug 104225</a>. | |
| 59 </p> | |
| 60 | |
| 61 <input type="text" id="input">Value</input> | |
| 62 </body> | |
| 63 </html> | |
| OLD | NEW |