aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2010-03-26 19:53:43 -0400
committerScott González <scott.gonzalez@gmail.com>2010-03-26 19:53:43 -0400
commit9541bd0bf2ca72795e8f2b2c1d3accc32afcac96 (patch)
tree452da6246365c2022b80ed812e4765a9eb655dbb /tests/unit
parentb297b3fa6a1e4b6cba735a10ca03a6175f8eda3a (diff)
downloadjquery-ui-9541bd0bf2ca72795e8f2b2c1d3accc32afcac96.tar.gz
jquery-ui-9541bd0bf2ca72795e8f2b2c1d3accc32afcac96.zip
Position: Use parseInt() to prevent fractional pixel values.
Fixes #5280 - ui.position generates different position in static context.
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/position/position.html4
-rw-r--r--tests/unit/position/position_core.js18
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/unit/position/position.html b/tests/unit/position/position.html
index 5a54e44c9..ca5f2585d 100644
--- a/tests/unit/position/position.html
+++ b/tests/unit/position/position.html
@@ -43,5 +43,9 @@
<div style="position: absolute; height: 5000px; width: 5000px;"></div>
+<div id="bug-5280" style="height: 30px; width: 201px;">
+ <div style="width: 50px; height: 10px;"></div>
+</div>
+
</body>
</html>
diff --git a/tests/unit/position/position_core.js b/tests/unit/position/position_core.js
index 4d2716ced..57e02da0a 100644
--- a/tests/unit/position/position_core.js
+++ b/tests/unit/position/position_core.js
@@ -330,4 +330,22 @@ test("collision: none, with offset", function() {
}, { top: -13, left: -12 }, "left top, negative offset");
});
+//test('bug #5280: consistent results (avoid fractional values)', function() {
+// var wrapper = $('#bug-5280'),
+// elem = wrapper.children(),
+// offset1 = elem.position({
+// my: 'center',
+// at: 'center',
+// of: wrapper,
+// collision: 'none'
+// }).offset(),
+// offset2 = elem.position({
+// my: 'center',
+// at: 'center',
+// of: wrapper,
+// collision: 'none'
+// }).offset();
+// same(offset1, offset2);
+//});
+
})(jQuery);