Fingertips-headless-squirrel 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. data/README.rdoc +53 -0
  2. data/Rakefile +49 -0
  3. data/VERSION.yml +4 -0
  4. data/bin/jstest +10 -0
  5. data/lib/headless_squirrel/runner.rb +70 -0
  6. data/lib/headless_squirrel/test.rb +17 -0
  7. data/lib/headless_squirrel/test_case.rb +121 -0
  8. data/lib/headless_squirrel.rb +2 -0
  9. data/test/fixtures/a_unit_test.html +27 -0
  10. data/test/fixtures/a_unit_test.js +22 -0
  11. data/test/regression/prototype/unit/ajax_test.html +29 -0
  12. data/test/regression/prototype/unit/array_test.html +28 -0
  13. data/test/regression/prototype/unit/assets/prototype.js +4900 -0
  14. data/test/regression/prototype/unit/assets/unittest.css +50 -0
  15. data/test/regression/prototype/unit/assets/unittest.js +615 -0
  16. data/test/regression/prototype/unit/assets/unittest_transport.js +1 -0
  17. data/test/regression/prototype/unit/base_test.html +27 -0
  18. data/test/regression/prototype/unit/class_test.html +27 -0
  19. data/test/regression/prototype/unit/date_test.html +27 -0
  20. data/test/regression/prototype/unit/dom_test.html +304 -0
  21. data/test/regression/prototype/unit/element_mixins_test.html +30 -0
  22. data/test/regression/prototype/unit/enumerable_test.html +35 -0
  23. data/test/regression/prototype/unit/event_test.html +31 -0
  24. data/test/regression/prototype/unit/fixtures/ajax.html +2 -0
  25. data/test/regression/prototype/unit/fixtures/ajax.js +42 -0
  26. data/test/regression/prototype/unit/fixtures/array.html +1 -0
  27. data/test/regression/prototype/unit/fixtures/class.js +83 -0
  28. data/test/regression/prototype/unit/fixtures/content.html +1 -0
  29. data/test/regression/prototype/unit/fixtures/data.json +1 -0
  30. data/test/regression/prototype/unit/fixtures/dom.css +84 -0
  31. data/test/regression/prototype/unit/fixtures/dom.html +278 -0
  32. data/test/regression/prototype/unit/fixtures/dom.js +17 -0
  33. data/test/regression/prototype/unit/fixtures/element_mixins.html +4 -0
  34. data/test/regression/prototype/unit/fixtures/element_mixins.js +2 -0
  35. data/test/regression/prototype/unit/fixtures/empty.html +0 -0
  36. data/test/regression/prototype/unit/fixtures/empty.js +1 -0
  37. data/test/regression/prototype/unit/fixtures/enumerable.html +8 -0
  38. data/test/regression/prototype/unit/fixtures/enumerable.js +23 -0
  39. data/test/regression/prototype/unit/fixtures/event.html +4 -0
  40. data/test/regression/prototype/unit/fixtures/form.html +108 -0
  41. data/test/regression/prototype/unit/fixtures/function.js +13 -0
  42. data/test/regression/prototype/unit/fixtures/hash.js +25 -0
  43. data/test/regression/prototype/unit/fixtures/hello.js +1 -0
  44. data/test/regression/prototype/unit/fixtures/logo.gif +0 -0
  45. data/test/regression/prototype/unit/fixtures/object.html +6 -0
  46. data/test/regression/prototype/unit/fixtures/object.js +7 -0
  47. data/test/regression/prototype/unit/fixtures/position.html +9 -0
  48. data/test/regression/prototype/unit/fixtures/selector.html +71 -0
  49. data/test/regression/prototype/unit/fixtures/string.js +8 -0
  50. data/test/regression/prototype/unit/fixtures/unittest.html +18 -0
  51. data/test/regression/prototype/unit/form_test.html +135 -0
  52. data/test/regression/prototype/unit/function_test.html +27 -0
  53. data/test/regression/prototype/unit/hash_test.html +27 -0
  54. data/test/regression/prototype/unit/number_test.html +27 -0
  55. data/test/regression/prototype/unit/object_test.html +32 -0
  56. data/test/regression/prototype/unit/periodical_executer_test.html +27 -0
  57. data/test/regression/prototype/unit/position_test.html +36 -0
  58. data/test/regression/prototype/unit/prototype_test.html +27 -0
  59. data/test/regression/prototype/unit/range_test.html +27 -0
  60. data/test/regression/prototype/unit/regexp_test.html +27 -0
  61. data/test/regression/prototype/unit/selector_test.html +98 -0
  62. data/test/regression/prototype/unit/string_test.html +27 -0
  63. data/test/regression/prototype/unit/tests/ajax_test.js +379 -0
  64. data/test/regression/prototype/unit/tests/array_test.js +186 -0
  65. data/test/regression/prototype/unit/tests/base_test.js +43 -0
  66. data/test/regression/prototype/unit/tests/class_test.js +136 -0
  67. data/test/regression/prototype/unit/tests/date_test.js +5 -0
  68. data/test/regression/prototype/unit/tests/dom_test.js +1493 -0
  69. data/test/regression/prototype/unit/tests/element_mixins_test.js +32 -0
  70. data/test/regression/prototype/unit/tests/enumerable_test.js +271 -0
  71. data/test/regression/prototype/unit/tests/event_test.js +235 -0
  72. data/test/regression/prototype/unit/tests/form_test.js +382 -0
  73. data/test/regression/prototype/unit/tests/function_test.js +133 -0
  74. data/test/regression/prototype/unit/tests/hash_test.js +178 -0
  75. data/test/regression/prototype/unit/tests/number_test.js +44 -0
  76. data/test/regression/prototype/unit/tests/object_test.js +180 -0
  77. data/test/regression/prototype/unit/tests/periodical_executer_test.js +15 -0
  78. data/test/regression/prototype/unit/tests/position_test.js +44 -0
  79. data/test/regression/prototype/unit/tests/prototype_test.js +43 -0
  80. data/test/regression/prototype/unit/tests/range_test.js +58 -0
  81. data/test/regression/prototype/unit/tests/regexp_test.js +42 -0
  82. data/test/regression/prototype/unit/tests/selector_test.js +408 -0
  83. data/test/regression/prototype/unit/tests/string_test.js +548 -0
  84. data/test/regression/prototype/unit/tests/unittest_test.js +148 -0
  85. data/test/regression/prototype/unit/unittest_test.html +45 -0
  86. data/test/regression/prototype/upstream +1 -0
  87. data/test/regression/scriptaculous/src/builder.js +134 -0
  88. data/test/regression/scriptaculous/src/controls.js +963 -0
  89. data/test/regression/scriptaculous/src/dragdrop.js +973 -0
  90. data/test/regression/scriptaculous/src/effects.js +1122 -0
  91. data/test/regression/scriptaculous/src/javascripttest.rb +203 -0
  92. data/test/regression/scriptaculous/src/scriptaculous.js +66 -0
  93. data/test/regression/scriptaculous/src/slider.js +273 -0
  94. data/test/regression/scriptaculous/src/sound.js +57 -0
  95. data/test/regression/scriptaculous/src/unittest.js +566 -0
  96. data/test/regression/scriptaculous/unit/_ajax_inplaceeditor_ipce_alt_text.html +1 -0
  97. data/test/regression/scriptaculous/unit/_ajax_inplaceeditor_ipce_collection.js +1 -0
  98. data/test/regression/scriptaculous/unit/_ajax_inplaceeditor_result.html +1 -0
  99. data/test/regression/scriptaculous/unit/_ajax_inplaceeditor_result2.html +1 -0
  100. data/test/regression/scriptaculous/unit/_ajax_inplaceeditor_tagged.html +1 -0
  101. data/test/regression/scriptaculous/unit/_ajax_inplaceeditor_text.html +1 -0
  102. data/test/regression/scriptaculous/unit/_ajax_updater_result.html +20 -0
  103. data/test/regression/scriptaculous/unit/_autocomplete_result.html +11 -0
  104. data/test/regression/scriptaculous/unit/_autocomplete_result_nobr.html +1 -0
  105. data/test/regression/scriptaculous/unit/ajax_autocompleter_test.html +243 -0
  106. data/test/regression/scriptaculous/unit/ajax_inplaceeditor_test.html +895 -0
  107. data/test/regression/scriptaculous/unit/builder_test.html +262 -0
  108. data/test/regression/scriptaculous/unit/dragdrop_test.html +131 -0
  109. data/test/regression/scriptaculous/unit/effects_test.html +547 -0
  110. data/test/regression/scriptaculous/unit/element_test.html +116 -0
  111. data/test/regression/scriptaculous/unit/icon.png +0 -0
  112. data/test/regression/scriptaculous/unit/index.html +70 -0
  113. data/test/regression/scriptaculous/unit/loading_test.html +41 -0
  114. data/test/regression/scriptaculous/unit/position_clone_test.html +312 -0
  115. data/test/regression/scriptaculous/unit/slider_test.html +437 -0
  116. data/test/regression/scriptaculous/unit/sortable_test.html +205 -0
  117. data/test/regression/scriptaculous/unit/string_test.html +71 -0
  118. data/test/regression/scriptaculous/unit/unittest_test.html +154 -0
  119. data/test/regression/scriptaculous/upstream +1 -0
  120. data/test/test_helper.rb +20 -0
  121. data/test/unit/runner_test.rb +165 -0
  122. data/test/unit/test_case_test.rb +168 -0
  123. data/test/unit/test_test.rb +24 -0
  124. metadata +179 -0
@@ -0,0 +1,70 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <title>script.aculo.us Unit test file</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7
+ <script src="../../lib/prototype.js" type="text/javascript"></script>
8
+ <script src="../../src/scriptaculous.js" type="text/javascript"></script>
9
+ <script src="../../src/unittest.js" type="text/javascript"></script>
10
+ <link rel="stylesheet" href="../test.css" type="text/css" />
11
+ </head>
12
+ <body class="navigation">
13
+
14
+ <h1>script.aculo.us<br/>Unit Tests</h1>
15
+
16
+ <p id="version"></p>
17
+
18
+ <script type="text/javascript" language="javascript" charset="utf-8">
19
+ // <![CDATA[
20
+ $('version').innerHTML = 'script.aculo.us version '+Scriptaculous.Version+'<br/>Prototype version ' + Prototype.Version;
21
+ // ]]>
22
+ </script>
23
+
24
+ <p><a href="http://wiki.script.aculo.us/scriptaculous/show/UnitTesting" target="test">Documentation</a></p>
25
+
26
+ <h2>scriptaculous.js</h2>
27
+ <ul>
28
+ <li><a href="loading_test.html" target="test">Dynamic loading test</a></li>
29
+ </ul>
30
+
31
+ <h2>effects.js</h2>
32
+ <ul>
33
+ <li><a href="effects_test.html" target="test">Effects test</a></li>
34
+ <li><a href="string_test.html" target="test">String test</a></li>
35
+ <li><a href="element_test.html" target="test">Element extensions test</a></li>
36
+ <li><a href="position_clone_test.html" target="test">Position.clone test</a></li>
37
+ </ul>
38
+
39
+ <h2>dragdrop.js</h2>
40
+ <ul>
41
+ <li><a href="dragdrop_test.html" target="test">Drag &amp; Drop test</a></li>
42
+ <li><a href="sortable_test.html" target="test">Sortable test</a></li>
43
+ </ul>
44
+
45
+ <h2>builder.js</h2>
46
+ <ul>
47
+ <li><a href="builder_test.html" target="test">Builder test</a></li>
48
+ </ul>
49
+
50
+ <h2>controls.js</h2>
51
+ <ul>
52
+ <li><a href="ajax_autocompleter_test.html" target="test">Ajax.Autocompleter test</a></li>
53
+ <li><a href="ajax_inplaceeditor_test.html" target="test">Ajax.InPlaceEditor test</a></li>
54
+ <li>Note: unit tests work on Firefox only. The controls themselves are fully supported on IE6+, Firefox and Safari.</li>
55
+ </ul>
56
+
57
+ <h2>slider.js</h2>
58
+ <ul>
59
+ <li><a href="slider_test.html" target="test">Control.Slider test</a></li>
60
+ </ul>
61
+
62
+
63
+ <h2>unittest.js</h2>
64
+ <ul>
65
+ <li><a href="unittest_test.html" target="test">Unittest test</a></li>
66
+ <li><a href="bdd_test.html" target="test">BDD test</a></li>
67
+ </ul>
68
+
69
+ </body>
70
+ </html>
@@ -0,0 +1,41 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <title>script.aculo.us Unit test file</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7
+ <script src="../../prototype/unit/assets/prototype.js" type="text/javascript"></script>
8
+ <script src="../src/scriptaculous.js" type="text/javascript"></script>
9
+ <script src="../../prototype/unit/assets/unittest.js" type="text/javascript"></script>
10
+ <link rel="stylesheet" href="../../prototype/unit/assets/unittest.css" type="text/css" />
11
+ </head>
12
+ <body>
13
+ <h1>script.aculo.us Unit test file</h1>
14
+ <p>
15
+ Test dynamic loading in scriptaculous.js
16
+ </p>
17
+
18
+ <!-- Log output -->
19
+ <div id="testlog"> </div>
20
+
21
+ <!-- Tests follow -->
22
+ <script type="text/javascript" language="javascript" charset="utf-8">
23
+ // <![CDATA[
24
+
25
+ new Test.Unit.Runner({
26
+
27
+ testDynamicLoading: function() { with(this) {
28
+
29
+ // not loaded: controls
30
+ assertNull(Ajax.Autocompleter || null);
31
+ assertNull(Form.Element.DelayedObserver || null);
32
+
33
+ // we loading dragdrop
34
+ assertNotNull(Draggable || null);
35
+ }}
36
+
37
+ }, "testlog");
38
+ // ]]>
39
+ </script>
40
+ </body>
41
+ </html>
@@ -0,0 +1,312 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <title>script.aculo.us Unit test file</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7
+ <script src="../../prototype/unit/assets/prototype.js" type="text/javascript"></script>
8
+ <script src="../src/scriptaculous.js" type="text/javascript"></script>
9
+ <script src="../../prototype/unit/assets/unittest.js" type="text/javascript"></script>
10
+ <link rel="stylesheet" href="../../prototype/unit/assets/unittest.css" type="text/css" />
11
+ </head>
12
+ <body>
13
+ <h1>script.aculo.us Unit test file</h1>
14
+ <p>
15
+ Tests for Postion.clone (to be moved to Prototype)
16
+ </p>
17
+
18
+ <!-- Log output -->
19
+ <div id="testlog"> </div>
20
+
21
+ <!-- Tests follow -->
22
+ <script type="text/javascript" language="javascript" charset="utf-8">
23
+ // <![CDATA[
24
+
25
+ function prepareTarget(contained, position1, position2) {
26
+ var target;
27
+ if($('target_div')) Element.remove('target_div');
28
+ if($('container_div')) Element.remove('container_div');
29
+ if(contained) {
30
+ target = Builder.node('div',
31
+ {id: 'container_div', style: 'position:' + position1},
32
+ [Builder.node('div', {id: 'target_div', style: 'position: ' +position2})]);
33
+ } else {
34
+ target = Builder.node('div',
35
+ {id: 'target_div', style: 'position:' + position1}, '456');
36
+ }
37
+ document.body.appendChild(target);
38
+ Position.clone($('source_div'),$('target_div'));
39
+ }
40
+
41
+ function prepareTargetHidden(contained, position1, position2) {
42
+ var target;
43
+ if($('target_div')) Element.remove('target_div');
44
+ if($('container_div')) Element.remove('container_div');
45
+ if(contained) {
46
+ target = Builder.node('div',
47
+ {id: 'container_div', style: 'position:' + position1},
48
+ [Builder.node('div', {id: 'target_div', style: 'display:none; position: ' +position2})]);
49
+ } else {
50
+ target = Builder.node('div',
51
+ {id: 'target_div', style: 'display:none; position:' + position1}, '456');
52
+ }
53
+ document.body.appendChild(target);
54
+ Position.clone($('source_div'),$('target_div'));
55
+ Element.show($('target_div'));
56
+ }
57
+
58
+ new Test.Unit.Runner({
59
+
60
+ teardown: function() {
61
+ Element.remove($('source_div'));
62
+ },
63
+
64
+ testPositionCloneFromAbsolute: function() { with(this) {
65
+ var source = Builder.node('div',
66
+ {id: 'source_div', style: 'position:absolute; top:20px; left:120px; width:100px; height:50px;'}, '123');
67
+ document.body.appendChild(source);
68
+ var expected = Object.inspect([120, 20]);
69
+ assertEqual(expected, Object.inspect(Position.page($('source_div'))));
70
+
71
+ prepareTarget(false, 'absolute');
72
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
73
+ "Clone to absolute BODY child");
74
+
75
+ prepareTarget(false, 'fixed');
76
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
77
+ "Clone to fixed BODY child");
78
+
79
+ prepareTarget(true, 'absolute', 'absolute');
80
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
81
+ "Clone to absolute child of absolute BODY child");
82
+
83
+ prepareTarget(true, 'absolute', 'fixed');
84
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
85
+ "Clone to fixed child of absolute BODY child");
86
+
87
+ prepareTarget(true, 'relative', 'absolute');
88
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
89
+ "Clone to absolute child of relative BODY child");
90
+
91
+ prepareTarget(true, 'relative', 'fixed');
92
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
93
+ "Clone to fixed child of relative BODY child");
94
+
95
+ prepareTarget(true, 'static', 'absolute');
96
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
97
+ "Clone to absolute child of static BODY child");
98
+
99
+ prepareTarget(true, 'static', 'fixed');
100
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
101
+ "Clone to fixed child of static BODY child");
102
+ }},
103
+
104
+ testPositionCloneFromRelative: function() { with(this) {
105
+ var source = Builder.node('div',
106
+ {id: 'source_div', style: 'position:relative; top:20px; left:120px; width:100px; height:50px;'}, '123');
107
+ document.body.appendChild(source);
108
+ var expected = Object.inspect(Position.page($('source_div')));
109
+ assertEqual(expected, Object.inspect(Position.page($('source_div'))));
110
+
111
+ prepareTarget(false, 'absolute');
112
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
113
+ "Clone to absolute BODY child");
114
+
115
+ prepareTarget(false, 'fixed');
116
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
117
+ "Clone to fixed BODY child");
118
+
119
+ prepareTarget(true, 'absolute', 'absolute');
120
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
121
+ "Clone to absolute child of absolute BODY child");
122
+
123
+ prepareTarget(true, 'absolute', 'fixed');
124
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
125
+ "Clone to fixed child of absolute BODY child");
126
+
127
+ prepareTarget(true, 'relative', 'absolute');
128
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
129
+ "Clone to absolute child of relative BODY child");
130
+
131
+ prepareTarget(true, 'relative', 'fixed');
132
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
133
+ "Clone to fixed child of relative BODY child");
134
+
135
+ prepareTarget(true, 'static', 'absolute');
136
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
137
+ "Clone to absolute child of static BODY child");
138
+
139
+ prepareTarget(true, 'static', 'fixed');
140
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
141
+ "Clone to fixed child of static BODY child");
142
+ }},
143
+
144
+ testPositionCloneFromStatic: function() { with(this) {
145
+ var source = Builder.node('div',
146
+ {id: 'source_div', style: 'top:20px; left:120px; width:100px; height:50px;'}, '123');
147
+ document.body.appendChild(source);
148
+ var expected = Object.inspect(Position.page($('source_div')));
149
+ assertEqual(expected, Object.inspect(Position.page($('source_div'))));
150
+
151
+ prepareTarget(false, 'absolute');
152
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
153
+ "Clone to absolute BODY child");
154
+
155
+ prepareTarget(false, 'fixed');
156
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
157
+ "Clone to fixed BODY child");
158
+
159
+ prepareTarget(true, 'absolute', 'absolute');
160
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
161
+ "Clone to absolute child of absolute BODY child");
162
+
163
+ prepareTarget(true, 'absolute', 'fixed');
164
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
165
+ "Clone to fixed child of absolute BODY child");
166
+
167
+ prepareTarget(true, 'relative', 'absolute');
168
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
169
+ "Clone to absolute child of relative BODY child");
170
+
171
+ prepareTarget(true, 'relative', 'fixed');
172
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
173
+ "Clone to fixed child of relative BODY child");
174
+
175
+ prepareTarget(true, 'static', 'absolute');
176
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
177
+ "Clone to absolute child of static BODY child");
178
+
179
+ prepareTarget(true, 'static', 'fixed');
180
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
181
+ "Clone to fixed child of static BODY child");
182
+ }},
183
+
184
+ testPositionCloneFromAbsoluteWithHiddenTarget: function() { with(this) {
185
+ var source = Builder.node('div',
186
+ {id: 'source_div', style: 'position:absolute; top:20px; left:120px; width:100px; height:50px;'}, '123');
187
+ document.body.appendChild(source);
188
+ var expected = Object.inspect([120, 20]);
189
+ assertEqual(expected, Object.inspect(Position.page($('source_div'))));
190
+
191
+ prepareTargetHidden(false, 'absolute');
192
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
193
+ "Clone to absolute BODY child");
194
+
195
+ prepareTargetHidden(false, 'fixed');
196
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
197
+ "Clone to fixed BODY child");
198
+
199
+ prepareTargetHidden(true, 'absolute', 'absolute');
200
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
201
+ "Clone to absolute child of absolute BODY child");
202
+
203
+ prepareTargetHidden(true, 'absolute', 'fixed');
204
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
205
+ "Clone to fixed child of absolute BODY child");
206
+
207
+ prepareTargetHidden(true, 'relative', 'absolute');
208
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
209
+ "Clone to absolute child of relative BODY child");
210
+
211
+ prepareTargetHidden(true, 'relative', 'fixed');
212
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
213
+ "Clone to fixed child of relative BODY child");
214
+
215
+ prepareTargetHidden(true, 'static', 'absolute');
216
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
217
+ "Clone to absolute child of static BODY child");
218
+
219
+ prepareTargetHidden(true, 'static', 'fixed');
220
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
221
+ "Clone to fixed child of static BODY child");
222
+ }},
223
+
224
+ testPositionCloneFromRelativeWithHiddenTarget: function() { with(this) {
225
+ var source = Builder.node('div',
226
+ {id: 'source_div', style: 'position:relative; top:20px; left:120px; width:100px; height:50px;'}, '123');
227
+ document.body.appendChild(source);
228
+ var expected = Object.inspect(Position.page($('source_div')));
229
+ assertEqual(expected, Object.inspect(Position.page($('source_div'))));
230
+
231
+ prepareTargetHidden(false, 'absolute');
232
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
233
+ "Clone to absolute BODY child");
234
+
235
+ prepareTargetHidden(false, 'fixed');
236
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
237
+ "Clone to fixed BODY child");
238
+
239
+ prepareTargetHidden(true, 'absolute', 'absolute');
240
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
241
+ "Clone to absolute child of absolute BODY child");
242
+
243
+ prepareTargetHidden(true, 'absolute', 'fixed');
244
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
245
+ "Clone to fixed child of absolute BODY child");
246
+
247
+ prepareTargetHidden(true, 'relative', 'absolute');
248
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
249
+ "Clone to absolute child of relative BODY child");
250
+
251
+ prepareTargetHidden(true, 'relative', 'fixed');
252
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
253
+ "Clone to fixed child of relative BODY child");
254
+
255
+ prepareTargetHidden(true, 'static', 'absolute');
256
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
257
+ "Clone to absolute child of static BODY child");
258
+
259
+ prepareTargetHidden(true, 'static', 'fixed');
260
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
261
+ "Clone to fixed child of static BODY child");
262
+ }},
263
+
264
+ testPositionCloneFromStaticWithHiddenTarget: function() { with(this) {
265
+ var source = Builder.node('div',
266
+ {id: 'source_div', style: 'top:20px; left:120px; width:100px; height:50px;'}, '123');
267
+ document.body.appendChild(source);
268
+ var expected = Object.inspect(Position.page($('source_div')));
269
+ assertEqual(expected, Object.inspect(Position.page($('source_div'))));
270
+
271
+ prepareTargetHidden(false, 'absolute');
272
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
273
+ "Clone to absolute BODY child");
274
+
275
+ prepareTargetHidden(false, 'fixed');
276
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
277
+ "Clone to fixed BODY child");
278
+
279
+ prepareTargetHidden(true, 'absolute', 'absolute');
280
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
281
+ "Clone to absolute child of absolute BODY child");
282
+
283
+ prepareTargetHidden(true, 'absolute', 'fixed');
284
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
285
+ "Clone to fixed child of absolute BODY child");
286
+
287
+ prepareTargetHidden(true, 'relative', 'absolute');
288
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
289
+ "Clone to absolute child of relative BODY child");
290
+
291
+ prepareTargetHidden(true, 'relative', 'fixed');
292
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
293
+ "Clone to fixed child of relative BODY child");
294
+
295
+ prepareTargetHidden(true, 'static', 'absolute');
296
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
297
+ "Clone to absolute child of static BODY child");
298
+
299
+ prepareTargetHidden(true, 'static', 'fixed');
300
+ assertEqual(expected, Object.inspect(Position.page($('target_div'))),
301
+ "Clone to fixed child of static BODY child");
302
+ }}
303
+
304
+ });
305
+
306
+ // ]]>
307
+ </script>
308
+
309
+ <!-- Test elements will be inserted after this -->
310
+
311
+ </body>
312
+ </html>