5 <script src="../../../resources/js-test.js"></script>
6 <script src="../resources/helper.js"></script>
9 -webkit-flow-into: article;
10 border: 2px solid black;
13 -webkit-flow-from: no_article;
15 display: inline-block;
22 #region_1, #region_2 { height:110px; width:200px; border: 1px solid red;}
28 <div id="content" style="height: 200px; background-color: green;"></div>
32 <div id="region_1"></div>
33 <div id="region_2"></div>
37 description("Tests the the NamedFlow object behavior as an EventTarget");
39 if (window.testRunner) {
40 testRunner.dumpAsText();
41 testRunner.waitUntilDone();
43 window.jsTestIsAsync = true;
44 function flowContent(flowName) {
45 var r = document.getElementById("region_1");
46 r.style.webkitFlowFrom = flowName;
47 r = document.getElementById("region_2");
48 r.style.webkitFlowFrom = flowName;
51 function makeFlowNull() {
52 shouldBeNonNull('getFlowByName("article")');
54 var el = document.getElementById("region_1");
55 el.style.webkitFlowFrom = "no_article";
56 el = document.getElementById("region_2");
57 el.style.webkitFlowFrom = "no_article";
58 el = document.getElementById("article");
59 el.style.webkitFlowInto = "no_article";
62 var recreated = false;
63 function makeFlowCreated() {
64 shouldBeNull('getFlowByName("article")');
67 var el = document.getElementById("region_1");
68 el.style.webkitFlowFrom = "article";
69 el = document.getElementById("region_2");
70 el.style.webkitFlowFrom = "article";
71 el = document.getElementById("article");
72 el.style.webkitFlowInto = "article";
78 function finishTest() {
79 shouldBe("updatedCount", "2");
83 function flowThreadUpdated(event) {
85 shouldBeEqualToString("event.target.name", "article");
87 if (updatedCount == 2) {
88 shouldBeTrue("recreated");
89 event.target.removeEventListener("webkitregionoversetchange", flowThreadUpdated);
91 setTimeout("finishTest()", 200);
96 shouldBeFalse("recreated");
98 // Set a timeout so the event reference to the target is discarded
99 setTimeout(makeFlowCreated, 10);
102 function startTest() {
103 var flowThread = getFlowByName("article");
104 flowThread.addEventListener("webkitregionoversetchange", flowThreadUpdated);
106 debug("Flow content");
107 flowContent("article");
110 window.addEventListener("load", startTest);