Skip to content
Permalink
Browse files

Fix #11721. Remove jQuery.boxModel, deprecate jQuery.support.boxModel.

This removes all internal uses of `jQuery.support.boxModel`. jQuery has never run unit tests with Quirks Mode and has not even feigned support for several years, so these remnants weren't doing much except giving false hope.

For now, `jQuery.support.boxModel` continues to have a value indicating whether the W3C box model is *generally* in use, but be aware that this is easily overridden on an element-by-element basis by the `box-model` CSS property. So don't trust this value.
  • Loading branch information...
mikesherov authored and dmethvin committed May 15, 2012
1 parent f76518e commit c4e22ad8b5edd52ac78ec44bf7df8a7f37403623
Showing with 14 additions and 20 deletions.
  1. +1 −1 src/effects.js
  2. +3 −4 src/offset.js
  3. +2 −2 src/support.js
  4. +0 −9 test/data/support/boxModelIE.html
  5. +7 −1 test/unit/offset.js
  6. +1 −3 test/unit/support.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();
}

@@ -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 ];
}

@@ -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;

This file was deleted.

Oops, something went wrong.
@@ -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 ) {
@@ -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 );

0 comments on commit c4e22ad

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