aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichał Gołębiowski <m.goleb@gmail.com>2013-08-22 00:33:57 +0200
committerMichał Gołębiowski <m.goleb@gmail.com>2013-09-05 18:26:21 +0200
commit776012b8b3898fad2e0727880f1dc4af5c7b33c1 (patch)
treec03730b064fb22a1e87f9ac93d6b24710f6fa0e7 /test
parentdfaee326e6605dc6d848c4c5022e39069d2cee65 (diff)
downloadjquery-776012b8b3898fad2e0727880f1dc4af5c7b33c1.tar.gz
jquery-776012b8b3898fad2e0727880f1dc4af5c7b33c1.zip
Fix #14084: attach the test div to documentElement, not body.
Diffstat (limited to 'test')
-rw-r--r--test/data/css/cssWidthBeforeDocReady.html26
-rw-r--r--test/unit/css.js5
2 files changed, 31 insertions, 0 deletions
diff --git a/test/data/css/cssWidthBeforeDocReady.html b/test/data/css/cssWidthBeforeDocReady.html
new file mode 100644
index 000000000..3bdd1b5ab
--- /dev/null
+++ b/test/data/css/cssWidthBeforeDocReady.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <style>
+ #test {
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ width: 100px;
+ height: 100px;
+ padding: 10px;
+ }
+ </style>
+</head>
+<body>
+<div id="test"></div>
+<script src="../../jquery.js"></script>
+<script>
+ var testWidth = jQuery( "#test" ).css( 'width' );
+ jQuery(function() {
+ window.parent.iframeCallback( testWidth );
+ });
+</script>
+</body>
+</html>
diff --git a/test/unit/css.js b/test/unit/css.js
index 82fd6828a..ec7758c34 100644
--- a/test/unit/css.js
+++ b/test/unit/css.js
@@ -797,6 +797,11 @@ test("css('width') and css('height') should respect box-sizing, see #11004", fun
equal( el_dis.css("height"), el_dis.css("height", el_dis.css("height")).css("height"), "css('height') is not respecting box-sizing for disconnected element, see #11004");
});
+testIframeWithCallback( "css('width') should works correctly before document ready", "css/cssWidthBeforeDocReady.html", function( cssWidthBeforeDocReady ) {
+ expect( 1 );
+ strictEqual( cssWidthBeforeDocReady, "100px", "elem.css('width') works correctly before document ready" );
+});
+
test("certain css values of 'normal' should be convertable to a number, see #8627", function() {
expect ( 2 );