Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/css/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ support.reliableTrDimensions = function() {
}

trStyle = window.getComputedStyle( tr );
reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) +
parseInt( trStyle.borderTopWidth, 10 ) +
parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight;
reliableTrDimensionsVal = ( Math.round( parseFloat( trStyle.height ) ) +
Math.round( parseFloat( trStyle.borderTopWidth ) ) +
Math.round( parseFloat( trStyle.borderBottomWidth ) ) ) === tr.offsetHeight;
Comment on lines +58 to +59
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IE / Edge, for which this support test was written, have much bigger differences here (something like 3 vs. 9) so rounding shouldn't affect it.


documentElement.removeChild( table );
}
Expand Down
24 changes: 24 additions & 0 deletions test/data/support/zoom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<style>
html {
zoom: 2.1;
}
</style>
</head>
<body>
<div>
<script src="../../jquery.js"></script>
<script src="../iframeTest.js"></script>
<script src="getComputedSupport.js"></script>
</div>
<script>
startIframeTest(
getComputedStyle( document.documentElement ),
getComputedSupport( jQuery.support )
);
</script>
</body>
</html>
8 changes: 6 additions & 2 deletions test/unit/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -1381,8 +1381,12 @@ testIframe(
"css/cssWidthBrowserZoom.html",
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" );

// Support: Firefox 126+
// Newer Firefox implements CSS zoom in a way it affects
// those values slightly.
assert.ok( /^100(?:|\.0\d*)px$/.test( widthBeforeSet ), "elem.css('width') works correctly with browser zoom" );
assert.ok( /^100(?:|\.0\d*)px$/.test( widthAfterSet ), "elem.css('width', val) works correctly with browser zoom" );
}
);

Expand Down
10 changes: 10 additions & 0 deletions test/unit/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ testIframe(
}
);

testIframe(
"Verify correctness of support tests with CSS zoom on the root element",
"support/zoom.html",
function( assert, jQuery, window, document, htmlStyle, support ) {
assert.expect( 1 );
assert.deepEqual( jQuery.extend( {}, support ), computedSupport,
"Same support properties" );
}
);

( function() {
var expected, browserKey,
userAgent = window.navigator.userAgent,
Expand Down