Skip to content
Permalink
Browse files

Detect IE collapsing body margin directly rather than inferring it.

  • Loading branch information...
dmethvin committed Jun 18, 2012
1 parent 5c37506 commit c18f1f119e07b08793ffb1e98621170f5f2eaba4
Showing with 6 additions and 7 deletions.
  1. +6 −7 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;

This comment has been minimized.

Copy link
@mikesherov

mikesherov Jun 18, 2012

Member

Is this what it's come to!?

This comment has been minimized.

Copy link
@dmethvin

dmethvin Jun 18, 2012

Author Member

Seems that way. :trollface: And it still didn't fix the IE8 fails. :(

This comment has been minimized.

Copy link
@mikesherov

mikesherov Jun 19, 2012

Member

I'll get a repro and fix tonight.


// 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" );

0 comments on commit c18f1f1

Please sign in to comment.
You can’t perform that action at this time.