| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <script src="../../../resources/js-test.js"></script> | |
| 4 <script src="../resources/helper.js"></script> | |
| 5 <style> | |
| 6 #article { | |
| 7 -webkit-flow-into: article; | |
| 8 border: 2px solid black; | |
| 9 } | |
| 10 #region_1, #region_2{ | |
| 11 overflow:visible; | |
| 12 display:inline-block; | |
| 13 vertical-align:top; | |
| 14 margin:10px; | |
| 15 } | |
| 16 #region_1 { height:500px; width:200px; } | |
| 17 #region_2 { height:50px; width:200px; } | |
| 18 </style> | |
| 19 </head> | |
| 20 <body> | |
| 21 <div id="article"> | |
| 22 <div> | |
| 23 <div id="content" style="height: 300px; background-color: green;"></div> | |
| 24 </div> | |
| 25 </div> | |
| 26 | |
| 27 <div id="region_1"></div> | |
| 28 <div id="region_2"></div> | |
| 29 | |
| 30 <script> | |
| 31 description("Tests WebKitNamedFlow.getRegions() and the DOM order of the lis
t") | |
| 32 if (window.testRunner) { | |
| 33 testRunner.dumpAsText(); | |
| 34 } | |
| 35 | |
| 36 function getRegionAt(index) { | |
| 37 var flow = getFlowByName("article"); | |
| 38 var regions = flow.getRegions(); | |
| 39 if (regions.length <= index) | |
| 40 return null; | |
| 41 | |
| 42 return regions[index]; | |
| 43 } | |
| 44 | |
| 45 function flowContent(flowName) { | |
| 46 var r = document.getElementById("region_1"); | |
| 47 r.style.webkitFlowFrom = flowName; | |
| 48 r = document.getElementById("region_2"); | |
| 49 r.style.webkitFlowFrom = flowName; | |
| 50 } | |
| 51 | |
| 52 function test() { | |
| 53 debug("Flow content"); | |
| 54 flowContent("article"); | |
| 55 | |
| 56 debug("Test if the regions are in DOM order"); | |
| 57 shouldBeEqualToString("getRegionAt(0).id", "region_1"); | |
| 58 shouldBeEqualToString("getRegionAt(1).id", "region_2"); | |
| 59 | |
| 60 debug("Empty content"); | |
| 61 flowContent(null); | |
| 62 } | |
| 63 test(); | |
| 64 </script> | |
| 65 </body> | |
| 66 </html> | |
| OLD | NEW |