aboutsummaryrefslogtreecommitdiffstats
path: root/test/data
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2023-11-07 00:35:52 +0100
committerGitHub <noreply@github.com>2023-11-07 00:35:52 +0100
commitb1e66a5faaf46ffcbcc27c79a9a224aaf851a987 (patch)
treec9d7be35b296bb57aee398f099b3786350ae8389 /test/data
parentf47c6a83370675af0eff227d0266b40f9f45514a (diff)
downloadjquery-b1e66a5faaf46ffcbcc27c79a9a224aaf851a987.tar.gz
jquery-b1e66a5faaf46ffcbcc27c79a9a224aaf851a987.zip
CSS: Fix reliableTrDimensions support test for initially hidden iframes
Closes gh-5358 Ref gh-5317 Ref gh-5359
Diffstat (limited to 'test/data')
-rw-r--r--test/data/css/cssComputeStyleTests.html34
-rw-r--r--test/data/testinit.js7
2 files changed, 40 insertions, 1 deletions
diff --git a/test/data/css/cssComputeStyleTests.html b/test/data/css/cssComputeStyleTests.html
new file mode 100644
index 000000000..9010d70fd
--- /dev/null
+++ b/test/data/css/cssComputeStyleTests.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Test computeStyleTests for hidden iframe</title>
+ <meta charset="utf-8">
+ <style>
+ * {
+ box-sizing: border-box;
+ }
+ #test {
+ position: absolute;
+ border: 10px solid black;
+ width: 400px;
+ }
+ #test-table {
+ position: absolute;
+ width: 100.7px;
+ border-spacing: 0;
+ }
+ </style>
+</head>
+<body>
+<div id="test"></div>
+<table id="test-table">
+ <tr id="test-tr"></tr>
+</table>
+<script src="../../jquery.js"></script>
+<script src="../iframeTest.js"></script>
+<script>
+ var initialHeight = $( "#test" ).outerHeight();
+ startIframeTest( initialHeight );
+</script>
+</body>
+</html>
diff --git a/test/data/testinit.js b/test/data/testinit.js
index aafe2902c..23cea8a40 100644
--- a/test/data/testinit.js
+++ b/test/data/testinit.js
@@ -243,7 +243,7 @@ this.ajaxTest = function( title, expect, options, wrapper ) {
} );
};
-this.testIframe = function( title, fileName, func, wrapper ) {
+this.testIframe = function( title, fileName, func, wrapper, iframeStyles ) {
if ( !wrapper ) {
wrapper = QUnit.test;
}
@@ -253,6 +253,11 @@ this.testIframe = function( title, fileName, func, wrapper ) {
.css( { position: "absolute", top: "0", left: "-600px", width: "500px" } )
.attr( { id: "qunit-fixture-iframe", src: url( fileName ) } );
+ // Add other iframe styles
+ if ( iframeStyles ) {
+ $iframe.css( iframeStyles );
+ }
+
// Test iframes are expected to invoke this via startIframeTest (cf. iframeTest.js)
window.iframeCallback = function() {
var args = Array.prototype.slice.call( arguments );