pixelPositionVal = divStyle.top !== "1%";
// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
- reliableMarginLeftVal = divStyle.marginLeft === "12px";
+ reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;
// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
// Some styles come back with percentage values, even though they shouldn't
div.style.right = "60%";
- pixelBoxStylesVal = divStyle.right === "36px";
+ pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;
// Support: IE 9 - 11 only
// Detect misreporting of content dimensions for box-sizing:border-box elements
- boxSizingReliableVal = divStyle.width === "36px";
+ boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;
// Support: IE 9 only
// Detect overflow:scroll screwiness (gh-3699)
div = null;
}
+ function roundPixelMeasures( measure ) {
+ return Math.round( parseFloat( measure ) );
+ }
+
var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
reliableMarginLeftVal,
container = document.createElement( "div" ),
--- /dev/null
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <style>
+ html {
+ zoom: 1.1;
+ }
+ #test {
+ width: 100px;
+ height: 100px;
+ padding: 10px;
+ border: 1px solid pink;
+ box-sizing: border-box;
+ }
+ </style>
+</head>
+<body>
+<div id="test"></div>
+<script src="../../jquery.js"></script>
+<script src="../iframeTest.js"></script>
+<script>
+ startIframeTest( jQuery( "#test" ).css( 'width' ) );
+</script>
+</body>
+</html>
}
);
+testIframe(
+ "css('width') should work correctly with browser zooming",
+ "css/cssWidthBrowserZoom.html",
+ function( assert, jQuery, window, document, cssWidthBrowserZoom ) {
+ assert.expect( 1 );
+ assert.strictEqual( cssWidthBrowserZoom, "100px", "elem.css('width') works correctly with browser zoom" );
+ }
+);
+
( function() {
var supportsFractionalGBCR,
qunitFixture = document.getElementById( "qunit-fixture" ),