mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
Tests: Workaround a tr width test issue in old iOS
Old iOS (<10) always rounds widths down, account for this in tests. Closes gh-5361 Ref gh-5317 Ref gh-5359
This commit is contained in:
parent
4e98980523
commit
b5b43adace
@ -1402,7 +1402,7 @@ testIframe(
|
||||
);
|
||||
|
||||
( function() {
|
||||
var supportsFractionalTrWidth,
|
||||
var supportsFractionalTrWidth, trWidth,
|
||||
epsilon = 0.1,
|
||||
table = jQuery( "<table><tr></tr></table>" ),
|
||||
tr = table.find( "tr" );
|
||||
@ -1429,12 +1429,16 @@ testIframe(
|
||||
jQuery( "#test" ).width( 600 );
|
||||
assert.strictEqual( jQuery( "#test" ).width(), 600, "width should be 600" );
|
||||
|
||||
trWidth = jQuery( "#test-tr" ).width();
|
||||
if ( supportsFractionalTrWidth ) {
|
||||
assert.ok(
|
||||
Math.abs( jQuery( "#test-tr" ).width() - 100.7 ) < epsilon,
|
||||
Math.abs( trWidth - 100.7 ) < epsilon,
|
||||
"tr width should be fractional" );
|
||||
} else {
|
||||
assert.strictEqual( jQuery( "#test-tr" ).width(), 101, "tr width as expected" );
|
||||
|
||||
// Support: iOS <10
|
||||
// Old iOS always rounds down.
|
||||
assert.strictEqual( trWidth === 100 ? 101 : trWidth, 101, "tr width as expected" );
|
||||
}
|
||||
},
|
||||
undefined,
|
||||
|
Loading…
Reference in New Issue
Block a user