Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(444)

Side by Side Diff: LayoutTests/fast/regions/webkit-named-flow-event-region-in-flexbox-no-overset-change.html

Issue 17176018: [CSS Regions] Add new regionOversetChange event (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <script src="../js/resources/js-test-pre.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;
apavlov 2013/06/21 15:43:06 We normally have a whitespace after ':' in propert
15 display:inline-block;
16 vertical-align:top;
17 margin:10px;
18 height:190px;
19 width:200px;
20 border: 1px solid red;
21 padding: 5px;
22 -webkit-flex-grow: 1;
23 -webkit-flex-basis: 100%;
24 }
25 #region_2 {
26 -webkit-flex-basis: 30%;
27 }
28 .content {
29 background-color: green;
30 border: 3px dashed blue;
31 margin: 5px;
32 }
33 #part1 {
34 height: 140px;
35 }
36 #part2 {
37 height: 160px;
38 }
39 #flexbox {
40 border: 2px solid green;
41 margin: 5px;
42 }
43 </style>
44 </head>
45 <body>
46 <div id="article">
47 <div>
48 <div id="part1" class="content"></div>
49 <div id="part2" class="content"></div>
50 </div>
51 </div>
52
53 <div id="flexbox">
54 <div id="region_1"></div>
55 <div id="region_2"></div>
56 </div>
57
58 <script>
59
apavlov 2013/06/21 15:43:06 This blank line is not necessary at the start of t
60 description("Tests the regionOversetChange event for regions inside flex boxes");
61
62 if (window.testRunner) {
63 testRunner.dumpAsText();
64 testRunner.waitUntilDone();
65 }
66 window.jsTestIsAsync = true;
67 function flowContent(flowName) {
68 var region = document.getElementById("region_1");
69 region.style.webkitFlowFrom = flowName;
70 region = document.getElementById("region_2");
71 region.style.webkitFlowFrom = flowName;
72 }
73
74 var eventFiredCount = 0;
75 function finishTest() {
76 shouldBe("eventFiredCount", "1");
77 finishJSTest();
78 }
79
80 function EnableFlexbox() {
apavlov 2013/06/21 15:43:06 Function names should be camelCasedLikeThis() (whi
81 debug("Engaging flexbox...")
82 document.getElementById("flexbox").style.display = "-webkit-flex";
83
84 // wait and make sure no other events arrive
apavlov 2013/06/21 15:43:06 // Comments should be full sentences. See [comment
85 setTimeout("finishTest()", 200);
86 }
87
88 function regionOversetChanged(event) {
89 ++eventFiredCount;
apavlov 2013/06/21 15:43:06 Odd indentation
90 shouldBeEqualToString("event.target.name", "article");
91
92 // activate the flexbox
apavlov 2013/06/21 15:43:06 [comments-sentences] at www.chromium.org/blink/cod
93 if (eventFiredCount == 1) {
94 if (window.testRunner)
95 EnableFlexbox();
96 else
97 setTimeout("EnableFlexbox()", 1000);
98
99 return;
100 }
101 }
102
103 function startTest() {
104 var flowThread = getFlowByName("article");
105 flowThread.addEventListener("webkitregionoversetchange", regionOvers etChanged);
106
107 debug("Flowing content into regions...");
108 flowContent("article");
109 }
110
111 window.addEventListener("load", startTest);
112 </script>
113 <script src="../js/resources/js-test-post.js"></script>
114 </body>
115 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698