Permalink
Browse files

added a unit test for EM unit support in link element media attributes

  • Loading branch information...
1 parent a2ab14b commit cb9569bed32a338d10077b50e71c1c1cfc05ded0 scottjehl committed Jan 16, 2012
Showing with 13 additions and 0 deletions.
  1. +1 −0 test/unit/index.html
  2. +5 −0 test/unit/test3.css
  3. +7 −0 test/unit/tests.js
@@ -7,6 +7,7 @@
<script src="http://github.com/jquery/qunit/raw/master/qunit/qunit.js"></script>
<link href="test.css" rel="stylesheet" />
<link href="test2.css" media="screen and (min-width: 1200px)" rel="stylesheet" />
+ <link href="test3.css" media="screen and (min-width: 87.5em)" rel="stylesheet" />
<script src="../../respond.src.js"></script>
<script src="tests.js"></script>
View
@@ -0,0 +1,5 @@
+/* this stylesheet was referenced via a link that had a media attr defined
+it should only apply on screen > 87.5em (1400px) */
+#testelem {
+ width: 25px;
+}
View
@@ -131,6 +131,13 @@ window.onload = function(){
}, 900);
});
+ asyncTest( "stylesheets with an EM-based media query in a media attribute apply when they should", function() {
+ window.resizeTo(1500,600);
+ setTimeout(function(){
+ ok( widthApplied( 25 ), "testelem is 25px wide when window is > 1400px wide" );
+ start();
+ }, 900);
+ });
}

0 comments on commit cb9569b

Please sign in to comment.