boxSizingNeeded = scrollBoxSize || extra,
isBorderBox = boxSizingNeeded &&
jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
- subtract = extra && boxModelAdjustment(
- elem,
- dimension,
- extra,
- isBorderBox,
- styles
- );
+ subtract = extra ?
+ boxModelAdjustment(
+ elem,
+ dimension,
+ extra,
+ isBorderBox,
+ styles
+ ) :
+ 0;
// Account for unreliable border-box dimensions by comparing offset* to computed and
// faking a content-box to get border and padding (gh-3699)
// Support: IE 9 only
// Detect overflow:scroll screwiness (gh-3699)
+ // Support: Chrome <=64
+ // Don't get tricked when zoom affects offsetWidth (gh-4029)
div.style.position = "absolute";
- scrollboxSizeVal = div.offsetWidth === 36 || "absolute";
+ scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12 || "absolute";
documentElement.removeChild( container );
zoom: 1.1;
}
#test {
+ position: absolute;
width: 100px;
height: 100px;
padding: 10px;
<script src="../../jquery.js"></script>
<script src="../iframeTest.js"></script>
<script>
- startIframeTest( jQuery( "#test" ).css( 'width' ) );
+ startIframeTest(
+ jQuery( "#test" ).css( 'width' ),
+ jQuery( "#test" ).css( 'width', '100px' ).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( assert, jQuery, window, document, widthBeforeSet, widthAfterSet ) {
+ assert.expect( 2 );
+ assert.strictEqual( widthBeforeSet, "100px", "elem.css('width') works correctly with browser zoom" );
+ assert.strictEqual( widthAfterSet, "100px", "elem.css('width', val) works correctly with browser zoom" );
}
);