aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2012-06-18 16:02:26 -0400
committerDave Methvin <dave.methvin@gmail.com>2012-06-18 16:02:26 -0400
commitc18f1f119e07b08793ffb1e98621170f5f2eaba4 (patch)
treec5d7250f021b9f2bef53eb6571daf00682533ebb /test
parent5c37506540550bfc596489d2bef93ac53adbe6e3 (diff)
downloadjquery-c18f1f119e07b08793ffb1e98621170f5f2eaba4.tar.gz
jquery-c18f1f119e07b08793ffb1e98621170f5f2eaba4.zip
Detect IE collapsing body margin directly rather than inferring it.
Diffstat (limited to 'test')
-rw-r--r--test/unit/offset.js13
1 files changed, 6 insertions, 7 deletions
diff --git a/test/unit/offset.js b/test/unit/offset.js
index 633b400f0..8cd5d8344 100644
--- a/test/unit/offset.js
+++ b/test/unit/offset.js
@@ -144,8 +144,8 @@ testIframe("offset/absolute", "absolute", function( jQuery ) {
testIframe("offset/relative", "relative", function( jQuery ) {
expect(60);
- // IE is collapsing the top margin of 1px
- var ie = document.documentMode && document.documentMode < 8;
+ // IE is collapsing the top margin of 1px; detect and adjust accordingly
+ var ie = jQuery("#relative-1").offset().top === 6;
// get offset
var tests = [
@@ -205,8 +205,8 @@ testIframe("offset/relative", "relative", function( jQuery ) {
testIframe("offset/static", "static", function( jQuery ) {
expect(80);
- // IE is collapsing the top margin of 1px
- var ie = document.documentMode && document.documentMode < 8;
+ // IE is collapsing the top margin of 1px; detect and adjust accordingly
+ var ie = jQuery("#static-1").offset().top === 6;
// get offset
var tests = [
@@ -349,13 +349,12 @@ testIframe("offset/table", "table", function( jQuery ) {
testIframe("offset/scroll", "scroll", function( jQuery, win ) {
expect(26);
- var ie = document.documentMode && document.documentMode < 8;
+ // IE is collapsing the top margin of 1px; detect and adjust accordingly
+ var ie = jQuery("#scroll-1").offset().top == 6;
- // IE is collapsing the top margin of 1px
equal( jQuery("#scroll-1").offset().top, ie ? 6 : 7, "jQuery('#scroll-1').offset().top" );
equal( jQuery("#scroll-1").offset().left, 7, "jQuery('#scroll-1').offset().left" );
- // IE is collapsing the top margin of 1px
equal( jQuery("#scroll-1-1").offset().top, ie ? 9 : 11, "jQuery('#scroll-1-1').offset().top" );
equal( jQuery("#scroll-1-1").offset().left, 11, "jQuery('#scroll-1-1').offset().left" );