Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <html> | |
|
pfeldman
2013/09/06 13:35:51
Lets make a protocol test for this and land no UI
| |
| 2 <head> | |
| 3 <style> | |
| 4 .relayout-boundary { | |
| 5 width: 200px; | |
| 6 height: 40px; | |
| 7 overflow: hidden; | |
| 8 } | |
| 9 | |
| 10 </style> | |
| 11 <script src="../../http/tests/inspector/inspector-test.js"></script> | |
| 12 <script src="../../http/tests/inspector/elements-test.js"></script> | |
| 13 <script> | |
| 14 function test() | |
| 15 { | |
| 16 var nodeIdsToTest = [ | |
| 17 "outer", | |
| 18 "boundary", | |
| 19 "inner", | |
| 20 "hidden" | |
| 21 ]; | |
| 22 function iterateOverIds(nextId) | |
| 23 { | |
| 24 if (nextId >= nodeIdsToTest.length) | |
| 25 InspectorTest.completeTest(); | |
| 26 function dumpResultsAndContinue(originalNode, error, foundNodeId) | |
| 27 { | |
| 28 var result; | |
| 29 if (error) | |
| 30 result = error; | |
| 31 else { | |
| 32 var foundNode = WebInspector.domAgent.nodeForId(foundNodeId); | |
| 33 result = foundNode ? foundNode.appropriateSelectorFor() : "null" ; | |
| 34 } | |
| 35 InspectorTest.addResult("Relayout boundary for " + originalNode.appr opriateSelectorFor() + " is: " + result); | |
| 36 iterateOverIds(nextId + 1); | |
| 37 } | |
| 38 function processNode(node) | |
| 39 { | |
| 40 node.findRelayoutBoundary(dumpResultsAndContinue.bind(this, node)); | |
| 41 } | |
| 42 InspectorTest.nodeWithId(nodeIdsToTest[nextId], processNode); | |
| 43 | |
| 44 } | |
| 45 iterateOverIds(0); | |
| 46 } | |
| 47 | |
| 48 </script> | |
| 49 </head> | |
| 50 <body onload="runTest()"> | |
| 51 <div id="outer"></div> | |
| 52 <div class="relayout-boundary" id="boundary"> | |
| 53 <div id="inner"></div> | |
| 54 <div style="display: none"> | |
| 55 <div id="hidden"></div> | |
| 56 </div> | |
| 57 </div> | |
| 58 </body> | |
| 59 </html> | |
| OLD | NEW |