Commit 83a355a9 authored by timmywil's avatar timmywil

jQuery.support.supportsFixedPosition -> jQuery.support.fixedPosition; Remove...

jQuery.support.supportsFixedPosition -> jQuery.support.fixedPosition; Remove jQuery.offset.supportProps and reference support in offset
parent cec4018d
...@@ -75,7 +75,7 @@ if ( "getBoundingClientRect" in document.documentElement ) { ...@@ -75,7 +75,7 @@ if ( "getBoundingClientRect" in document.documentElement ) {
left = elem.offsetLeft; left = elem.offsetLeft;
while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) { while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) { if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
break; break;
} }
...@@ -87,7 +87,7 @@ if ( "getBoundingClientRect" in document.documentElement ) { ...@@ -87,7 +87,7 @@ if ( "getBoundingClientRect" in document.documentElement ) {
top += elem.offsetTop; top += elem.offsetTop;
left += elem.offsetLeft; left += elem.offsetLeft;
if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) { if ( jQuery.support.doesNotAddBorder && !(jQuery.support.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
top += parseFloat( computedStyle.borderTopWidth ) || 0; top += parseFloat( computedStyle.borderTopWidth ) || 0;
left += parseFloat( computedStyle.borderLeftWidth ) || 0; left += parseFloat( computedStyle.borderLeftWidth ) || 0;
} }
...@@ -96,7 +96,7 @@ if ( "getBoundingClientRect" in document.documentElement ) { ...@@ -96,7 +96,7 @@ if ( "getBoundingClientRect" in document.documentElement ) {
offsetParent = elem.offsetParent; offsetParent = elem.offsetParent;
} }
if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) { if ( jQuery.support.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
top += parseFloat( computedStyle.borderTopWidth ) || 0; top += parseFloat( computedStyle.borderTopWidth ) || 0;
left += parseFloat( computedStyle.borderLeftWidth ) || 0; left += parseFloat( computedStyle.borderLeftWidth ) || 0;
} }
...@@ -109,7 +109,7 @@ if ( "getBoundingClientRect" in document.documentElement ) { ...@@ -109,7 +109,7 @@ if ( "getBoundingClientRect" in document.documentElement ) {
left += body.offsetLeft; left += body.offsetLeft;
} }
if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) { if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
top += Math.max( docElem.scrollTop, body.scrollTop ); top += Math.max( docElem.scrollTop, body.scrollTop );
left += Math.max( docElem.scrollLeft, body.scrollLeft ); left += Math.max( docElem.scrollLeft, body.scrollLeft );
} }
...@@ -118,23 +118,13 @@ if ( "getBoundingClientRect" in document.documentElement ) { ...@@ -118,23 +118,13 @@ if ( "getBoundingClientRect" in document.documentElement ) {
}; };
} }
jQuery.offset = {}; jQuery.offset = {
jQuery.each(
( "doesAddBorderForTableAndCells doesNotAddBorder " +
"doesNotIncludeMarginInBodyOffset subtractsBorderForOverflowNotVisible " +
"supportsFixedPosition" ).split(" "), function( i, prop ) {
jQuery.offset[ prop ] = jQuery.support[ prop ];
});
jQuery.extend( jQuery.offset, {
bodyOffset: function( body ) { bodyOffset: function( body ) {
var top = body.offsetTop, var top = body.offsetTop,
left = body.offsetLeft; left = body.offsetLeft;
if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) { if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) {
top += parseFloat( jQuery.css(body, "marginTop") ) || 0; top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
left += parseFloat( jQuery.css(body, "marginLeft") ) || 0; left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
} }
...@@ -184,7 +174,7 @@ jQuery.extend( jQuery.offset, { ...@@ -184,7 +174,7 @@ jQuery.extend( jQuery.offset, {
curElem.css( props ); curElem.css( props );
} }
} }
}); };
jQuery.fn.extend({ jQuery.fn.extend({
......
...@@ -289,7 +289,7 @@ jQuery.support = (function() { ...@@ -289,7 +289,7 @@ jQuery.support = (function() {
inner.style.top = "20px"; inner.style.top = "20px";
// safari subtracts parent border width here which is 5px // safari subtracts parent border width here which is 5px
offsetSupport.supportsFixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 ); offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 );
inner.style.position = inner.style.top = ""; inner.style.position = inner.style.top = "";
outer.style.overflow = "hidden"; outer.style.overflow = "hidden";
...@@ -301,8 +301,6 @@ jQuery.support = (function() { ...@@ -301,8 +301,6 @@ jQuery.support = (function() {
body.removeChild( container ); body.removeChild( container );
testElement = container = null; testElement = container = null;
// Extend both jQuery.offset and jQuery.support
jQuery.extend( jQuery.offset, offsetSupport );
jQuery.extend( support, offsetSupport ); jQuery.extend( support, offsetSupport );
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment