OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <meta charset="utf-8"> | |
5 <script src="../../../resources/js-test.js"></script> | |
6 <script src="../resources/helper.js"></script> | |
7 <style> | |
8 #article { | |
9 -webkit-flow-into: article; | |
10 border: 10px solid black; | |
11 } | |
12 #region_1, #region_2 { | |
13 -webkit-flow-from: no_article; | |
14 overflow: hidden; | |
15 display: inline-block; | |
16 vertical-align: top; | |
17 margin: 10px; | |
18 height: auto; | |
19 width: 200px; | |
20 border: 1px solid red; | |
21 padding: 5px; | |
22 } | |
23 .content { | |
24 background-color: green; | |
25 border: 3px dashed blue; | |
26 } | |
27 #part1 { | |
28 height: 180px; | |
29 } | |
30 #part2 { | |
31 -webkit-region-break-before: always; | |
32 height: 160px; | |
33 } | |
34 </style> | |
35 </head> | |
36 <body> | |
37 <div id="article"> | |
38 <div> | |
39 <div id="part1" class="content"></div> | |
40 <div id="part2" class="content"></div> | |
41 </div> | |
42 </div> | |
43 | |
44 <div id="region_1"></div> | |
45 <div id="region_2"></div> | |
46 | |
47 <script> | |
48 | |
49 description("Tests the regionOversetChange event for regions with height
:auto"); | |
50 | |
51 if (window.testRunner) { | |
52 testRunner.dumpAsText(); | |
53 testRunner.waitUntilDone(); | |
54 } | |
55 window.jsTestIsAsync = true; | |
56 function flowContent(flowName) { | |
57 var region = document.getElementById("region_1"); | |
58 region.style.webkitFlowFrom = flowName; | |
59 region = document.getElementById("region_2"); | |
60 region.style.webkitFlowFrom = flowName; | |
61 } | |
62 | |
63 var eventFiredCount = 0; | |
64 function finishTest() { | |
65 shouldBe("eventFiredCount", "1"); | |
66 finishJSTest(); | |
67 } | |
68 | |
69 function regionOversetChanged(event) { | |
70 ++eventFiredCount; | |
71 shouldBeEqualToString("event.target.name", "article"); | |
72 | |
73 // Wait and make sure no other events arrive. | |
74 setTimeout("finishTest()", 200); | |
75 } | |
76 | |
77 function startTest() { | |
78 var flowThread = getFlowByName("article"); | |
79 flowThread.addEventListener("webkitregionoversetchange", regionOvers
etChanged); | |
80 | |
81 debug("Flowing content into regions..."); | |
82 flowContent("article"); | |
83 } | |
84 | |
85 window.addEventListener("load", startTest); | |
86 </script> | |
87 </body> | |
88 </html> | |
OLD | NEW |