This repository was archived by the owner on Jan 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest-freeElement.html
71 lines (67 loc) · 2.3 KB
/
test-freeElement.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<!-- Qunit -->
<script src="qunit/jquery.js"></script>
<link rel="stylesheet" href="qunit/qunit.css" type="text/css"
media="screen"/>
<script type="text/javascript" src="qunit/qunit.js"></script>
<!-- Lib -->
<script src="../lib/wef/build/wef.js"></script>
<!-- Src -->
<script src="../src/templateLayout.js"></script>
<script src="../src/templateLayout.compiler.js"></script>
<script src="../src/templateLayout.generator.js"></script>
<!-- Example style -->
<link rel="stylesheet" href="test.css" type="text/css"
media="screen"/>
<script type="text/javascript">
window.onload = function () {
var text = "#parent {display: \"abcd\"} #child1 {position: d} #child2 {position: c} #child3 {position: b} #child4 {position: a}";
templateLayout(text).transform();
<!-- Test code -->
test("DOM child position", function () {
equal($("#free1").attr("id"),
$("#parent .templateLayoutTable tr:eq(0) td:eq(0) div div").attr("id"),
"Free elements are moved to default slot, first one");
});
}
</script>
<title></title>
</head>
<body>
<!-- Qunit code -->
<div>
<div id="qunit-header">CSS Template Layout test - Free elements handling
</div>
<div id="qunit-banner"></div>
<div id="qunit-testrunner-toolbar"></div>
<div id="qunit-userAgent"></div>
<ol id="qunit-tests"></ol>
<div id="qunit-fixture">test markup, will be hidden</div>
<div style="margin: 50px"></div>
</div>
<!-- Test -->
<div id="sourceHTML">
<div>This <code>DIV</code> is inside <code>#parent</code>.
</div>
<h1>Primero</h1>
<h2>Segundo</h2>
<h3>Tercero</h3>
<h4>Cuarto</h4>
</div>
<pre id="sourceTemplate">
"#parent {display: \"abcd\"} #child1 {position: d} #child2 {position: c} #child3 {position: b} #child4 {position: a}"
</pre>
<hr/>
<div id="parent">
<div id="free1">This <code>DIV</code> is inside <code>#parent</code>.
</div>
<h1 id="child1">Primero</h1>
<h2 id="child2">Segundo</h2>
<h3 id="child3">Tercero</h3>
<h4 id="child4">Cuarto</h4>
</div>
</body>
</html>