Skip to content

Commit 433ed6e

Browse files
committed
Merge remote branch 'davidmurdoch/ticket-5645'
2 parents 3dea8f1 + 40c0088 commit 433ed6e

File tree

6 files changed

+748
-62
lines changed

6 files changed

+748
-62
lines changed

tests/unit/position/position.html

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,47 +16,54 @@
1616
<script src="../testsuite.js"></script>
1717

1818
<script src="position_core.js"></script>
19+
<script src="position_core_within.js"></script>
1920

2021
<script src="../swarminject.js"></script>
2122
</head>
2223
<body>
23-
24-
<h1 id="qunit-header">jQuery UI Position Test Suite</h1>
25-
<h2 id="qunit-banner"></h2>
26-
<div id="qunit-testrunner-toolbar"></div>
27-
<h2 id="qunit-userAgent"></h2>
28-
<ol id="qunit-tests">
29-
</ol>
24+
<div style="position:relative; z-index:2;">
25+
<h1 id="qunit-header">jQuery UI Position Test Suite</h1>
26+
<h2 id="qunit-banner"></h2>
27+
<div id="qunit-testrunner-toolbar"></div>
28+
<h2 id="qunit-userAgent"></h2>
29+
<ol id="qunit-tests">
30+
</ol>
31+
</div>
3032

3133
<!--
3234
elements smaller than 10px have a line-height set on them to avoid a bug in IE6
3335
.height() returns the greater of the height and line-height
3436
-->
3537

36-
<div id="qunit-fixture" style="top: 0; left: 0;">
37-
<div id="el1" style="position: absolute; width: 6px; height: 6px; line-height: 6px;"></div>
38-
<div id="el2" style="position: absolute; width: 6px; height: 6px; line-height: 6px;"></div>
39-
<div id="parent" style="position: absolute; width: 6px; height: 6px; top: 4px; left: 4px; line-height: 6px;"></div>
40-
</div>
41-
42-
<div style="position: absolute; top: 0px; left: 0px">
43-
<div id="elx" style="position: absolute; width: 10px; height: 10px; line-height: 10px;"></div>
44-
<div id="parentx" style="position: absolute; width: 20px; height: 20px; top: 40px; left: 40px;"></div>
38+
<div id="qunit-fixture" style="top: 0; left: 0; z-index:1">
39+
<div id="within-container">
40+
<div id="el1" style="position: absolute; width: 6px; height: 6px; line-height: 6px;"></div>
41+
<div id="el2" style="position: absolute; width: 6px; height: 6px; line-height: 6px;"></div>
42+
<div id="parent" style="position: absolute; width: 6px; height: 6px; top: 4px; left: 4px; line-height: 6px;"></div>
43+
44+
<div style="position: absolute; top: 0px; left: 0px">
45+
<div id="elx" style="position: absolute; width: 10px; height: 10px; line-height: 10px;"></div>
46+
<div id="parentx" style="position: absolute; width: 20px; height: 20px; top: 40px; left: 40px;"></div>
47+
</div>
48+
49+
<div style="position: absolute; top: 200px; left: 100px;">
50+
<div id="el-offset-100-200" style="position: absolute; width: 10px; height: 10px; line-height: 10px;"></div>
51+
<div style="position: absolute; top: 100px; left: 50px;">
52+
<div id="el-two-offset-150-300" style="position: absolute; width: 10px; height: 10px; line-height: 10px;"></div>
53+
<div id="el-fixed" style="position: fixed; top: 200px; left: 200px;"></div>
54+
</div>
55+
</div>
56+
57+
<div style="position: absolute; height: 5000px; width: 5000px;"></div>
58+
59+
<div id="bug-5280" style="height: 30px; width: 201px;">
60+
<div style="width: 50px; height: 10px;"></div>
61+
</div>
62+
</div>
4563
</div>
4664

47-
<div style="position: absolute; top: 200px; left: 100px;">
48-
<div id="el-offset-100-200" style="position: absolute; width: 10px; height: 10px; line-height: 10px;"></div>
49-
<div style="position: absolute; top: 100px; left: 50px;">
50-
<div id="el-two-offset-150-300" style="position: absolute; width: 10px; height: 10px; line-height: 10px;"></div>
51-
<div id="el-fixed" style="position: fixed; top: 200px; left: 200px;"></div>
52-
</div>
53-
</div>
5465

55-
<div style="position: absolute; height: 5000px; width: 5000px;"></div>
5666

57-
<div id="bug-5280" style="height: 30px; width: 201px;">
58-
<div style="width: 50px; height: 10px;"></div>
59-
</div>
6067

6168
</body>
6269
</html>

tests/unit/position/position_core.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ test( "positions", function() {
6464
center: 3,
6565
right: 6,
6666
top: 0,
67-
center: 3,
6867
bottom: 6
6968
};
7069
var start = { left: 4, top: 4 };
@@ -316,6 +315,7 @@ test( "collision: fit, window scrolled", function() {
316315
if ( scrollTopSupport() ) {
317316
var win = $( window );
318317
win.scrollTop( 300 ).scrollLeft( 200 );
318+
319319
collisionTest({
320320
collision: "fit",
321321
at: "left-100 top-100"
@@ -324,6 +324,7 @@ test( "collision: fit, window scrolled", function() {
324324
collision: "fit",
325325
at: "right+100 bottom+100"
326326
}, { top: 300 + win.height() - 10, left: 200 + win.width() - 10 }, "right bottom" );
327+
327328
win.scrollTop( 0 ).scrollLeft( 0 );
328329
}
329330
});
@@ -351,7 +352,7 @@ test( "collision: flip, with offset", function() {
351352

352353
collisionTest2({
353354
collision: "flip",
354-
at: "left-2 top-3",
355+
at: "left-2 top-3"
355356
}, { top: $( window ).height() + 3, left: $( window ).width() + 2 }, "right bottom, negative offset" );
356357
});
357358

0 commit comments

Comments
 (0)