mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
CSS: ensure table styles do not affect reliableHiddenOffsets test
Fixes gh-3065 Close gh-3057
This commit is contained in:
parent
c43066c41e
commit
c41defb7f3
@ -162,6 +162,7 @@ define( [
|
||||
if ( reliableHiddenOffsetsVal ) {
|
||||
div.style.display = "";
|
||||
div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
|
||||
div.childNodes[ 0 ].style.borderCollapse = "separate";
|
||||
contents = div.getElementsByTagName( "td" );
|
||||
contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none";
|
||||
reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
|
||||
|
22
test/data/support/reliableHiddenOffsets.html
Normal file
22
test/data/support/reliableHiddenOffsets.html
Normal file
@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr" id="html">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<style>
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-style: solid;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<script src="../../jquery.js"></script>
|
||||
</div>
|
||||
<script>
|
||||
jQuery(function() {
|
||||
window.parent.iframeCallback( jQuery.support.reliableHiddenOffsets() );
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1105,6 +1105,15 @@ QUnit.test( ":visible/:hidden selectors", function( assert ) {
|
||||
assert.ok( !jQuery( "<div><div>Test</div></div>" ).find("div").is( ":visible" ), "Disconnected element child is not visible" );
|
||||
} );
|
||||
|
||||
testIframeWithCallback(
|
||||
"Table styles do not affect reliableHiddenOffsets support test (gh-3065)",
|
||||
"support/reliableHiddenOffsets.html",
|
||||
function( testResult, assert ) {
|
||||
assert.expect( 1 );
|
||||
|
||||
assert.equal( testResult, jQuery.support.reliableHiddenOffsets(), "reliableHiddenOffsets value not affected by table styles" );
|
||||
} );
|
||||
|
||||
QUnit.test( "Keep the last style if the new one isn't recognized by the browser (#14836)", function( assert ) {
|
||||
assert.expect( 2 );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user