"./var/getStyles",
"./support",
"../selector" // Get jQuery.contains
-], function( jQuery, rnumnonpx, rmargin, getStyles ) {
+], function( jQuery, rnumnonpx, rmargin, getStyles, support ) {
function curCSS( elem, name, computed ) {
var width, minWidth, maxWidth, ret,
ret = jQuery.style( elem, name );
}
- // Support: iOS < 6, Android 4.0-4.3 only
// A tribute to the "awesome hack by Dean Edwards"
- // iOS < 6 (at least) returns percentage for a larger set of values,
- // but width seems to be reliably pixels
- // this is against the CSSOM draft spec:
+ // Android Browser returns percentage for some values,
+ // but width seems to be reliably pixels.
+ // This is against the CSSOM draft spec:
// http://dev.w3.org/csswg/cssom/#resolved-values
- if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
+ if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
// Remember the original values
width = style.width;
], function( jQuery ) {
jQuery.expr.filters.hidden = function( elem ) {
+ return !jQuery.expr.filters.visible( elem );
+};
+jQuery.expr.filters.visible = function( elem ) {
// Support: Opera <= 12.12
// Opera reports offsetWidths and offsetHeights less than zero on some elements
// Use OR instead of AND as the element is not visible if either is true
// See tickets #10406 and #13132
- return elem.offsetWidth <= 0 || elem.offsetHeight <= 0;
-};
-jQuery.expr.filters.visible = function( elem ) {
- return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
+ return elem.offsetWidth > 0 || elem.offsetHeight > 0 || elem.getClientRects().length > 0;
};
} );
// Support: Firefox<29, Android 2.3
// Vendor-prefix box-sizing
- "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
- "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
- "border:1px;padding:1px;width:4px;position:absolute";
+ "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;" +
+ "position:relative;display:block;" +
+ "margin:auto;border:1px;padding:1px;" +
+ "top:1%;width:50%";
div.innerHTML = "";
documentElement.appendChild( container );
return box;
}
- // Support: BlackBerry 5, iOS 3 (original iPhone)
- // If we don't have gBCR, just use 0,0 rather than error
- if ( elem.getBoundingClientRect ) {
- box = elem.getBoundingClientRect();
- }
+ box = elem.getBoundingClientRect();
win = getWindow( doc );
return {
top: box.top + win.pageYOffset - docElem.clientTop,
// Support: Firefox<29, Android 2.3 (Prefixed box-sizing versions).
var parent = jQuery( "#foo" ).css( { width: "200px", height: "200px", "font-size": "16px" } ),
- el_bb = jQuery( "<div style='width:114px;height:114px;margin:5px;padding:3px;border:4px solid white;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;'>test</div>" ).appendTo( parent ),
- el = jQuery( "<div style='width:100px;height:100px;margin:5px;padding:3px;border:4px solid white;'>test</div>" ).appendTo( parent );
+ el_bb = jQuery( "<div style='margin:5px;padding:1px;border:2px solid black;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;'></div>" ).appendTo( parent ),
+ el = jQuery( "<div style='margin:5px;padding:1px;border:2px solid black;'></div>" ).appendTo( parent );
jQuery.each( {
"number": { set: 100, expected: 100 },