diff options
-rw-r--r-- | src/effects.js | 2 | ||||
-rw-r--r-- | src/offset.js | 7 | ||||
-rw-r--r-- | src/support.js | 4 | ||||
-rw-r--r-- | test/data/support/boxModelIE.html | 9 | ||||
-rw-r--r-- | test/unit/offset.js | 8 | ||||
-rw-r--r-- | test/unit/support.js | 4 |
6 files changed, 14 insertions, 20 deletions
diff --git a/src/effects.js b/src/effects.js index ff2d5dedf..26530a2f8 100644 --- a/src/effects.js +++ b/src/effects.js @@ -681,7 +681,7 @@ function defaultDisplay( nodeName ) { // document to it; WebKit & Firefox won't allow reusing the iframe document. if ( !iframeDoc || !iframe.createElement ) { iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document; - iframeDoc.write( ( jQuery.support.boxModel ? "<!doctype html>" : "" ) + "<html><body>" ); + iframeDoc.write("<!doctype html><html><body>"); iframeDoc.close(); } diff --git a/src/offset.js b/src/offset.js index 69c4d72ad..1288b79ff 100644 --- a/src/offset.js +++ b/src/offset.js @@ -20,8 +20,8 @@ if ( "getBoundingClientRect" in document.documentElement ) { win = getWindow( doc ), clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0, - scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop, - scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft, + scrollTop = win.pageYOffset || docElem.scrollTop, + scrollLeft = win.pageXOffset || docElem.scrollLeft, top = box.top + scrollTop - clientTop, left = box.left + scrollLeft - clientLeft; @@ -176,8 +176,7 @@ jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( me if ( val === undefined ) { return win ? (prop in win) ? win[ prop ] : - jQuery.support.boxModel && win.document.documentElement[ method ] || - win.document.body[ method ] : + win.document.documentElement[ method ] : elem[ method ]; } diff --git a/src/support.js b/src/support.js index 8e50a15b7..61acce40d 100644 --- a/src/support.js +++ b/src/support.js @@ -95,8 +95,8 @@ jQuery.support = (function() { boxSizingReliable: true }; - // jQuery.boxModel DEPRECATED in 1.3, use jQuery.support.boxModel instead - jQuery.boxModel = support.boxModel = (document.compatMode === "CSS1Compat"); + // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode + support.boxModel = (document.compatMode === "CSS1Compat"); // Make sure checked status is properly cloned input.checked = true; diff --git a/test/data/support/boxModelIE.html b/test/data/support/boxModelIE.html deleted file mode 100644 index 24e4c6100..000000000 --- a/test/data/support/boxModelIE.html +++ /dev/null @@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> -<body> - <script src="../include_js.php"></script> - <script> - jQuery(function() { window.parent.iframeCallback( document.compatMode, jQuery.support.boxModel ) }); - </script> -</body> -</html> diff --git a/test/unit/offset.js b/test/unit/offset.js index 526b93775..6664a6bdb 100644 --- a/test/unit/offset.js +++ b/test/unit/offset.js @@ -342,7 +342,7 @@ testIframe("offset/table", "table", function( jQuery ) { }); testIframe("offset/scroll", "scroll", function( jQuery, win ) { - expect(24); + expect(26); var ie = jQuery.browser.msie && parseInt( jQuery.browser.version, 10 ) < 8; @@ -397,6 +397,12 @@ testIframe("offset/scroll", "scroll", function( jQuery, win ) { notEqual( jQuery().scrollLeft(null), null, "jQuery().scrollLeft(null) testing setter on empty jquery object" ); strictEqual( jQuery().scrollTop(), null, "jQuery().scrollTop(100) testing setter on empty jquery object" ); strictEqual( jQuery().scrollLeft(), null, "jQuery().scrollLeft(100) testing setter on empty jquery object" ); + + // test setting scroll + jQuery( win ).scrollTop( 100 ); + jQuery( win ).scrollLeft( 101 ); + equal( jQuery( win ).scrollTop(), 100, "jQuery( win ).scrollTop() testing setter" ); + equal( jQuery( win ).scrollLeft(), 101, "jQuery( win ).scrollLeft() testing setter" ); }); testIframe("offset/body", "body", function( jQuery ) { diff --git a/test/unit/support.js b/test/unit/support.js index 7582d4bc4..d4d9dfe85 100644 --- a/test/unit/support.js +++ b/test/unit/support.js @@ -1,8 +1,6 @@ module("support", { teardown: moduleTeardown }); -testIframeWithCallback( "proper boxModel in compatMode CSS1Compat (IE6 and IE7)", "support/boxModelIE", function( compatMode, boxModel ) { - ok( compatMode !== "CSS1Compat" || boxModel, "boxModel properly detected" ); -}); +ok( jQuery.support.boxModel, "jQuery.support.boxModel is perpetually true since 1.8" ); testIframeWithCallback( "body background is not lost if set prior to loading jQuery (#9238)", "support/bodyBackground", function( color, support ) { expect( 2 ); |