OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../../resources/ahem.js"></script> |
2 <script src="../../resources/js-test.js"></script> | 3 <script src="../../resources/js-test.js"></script> |
3 <style> | 4 <style> |
4 .test { display: height: 10px; background: #ddf; font: 20px/1 Ahem; } | 5 .test { display: height: 10px; background: #ddf; font: 20px/1 Ahem; } |
5 #nocalc { width: 310px; } | 6 #nocalc { width: 310px; } |
6 #calc { width: calc(15em + 10px); width: -moz-calc(15em + 10px); width: calc(1
5em + 10px); } | 7 #calc { width: calc(15em + 10px); width: -moz-calc(15em + 10px); width: calc(1
5em + 10px); } |
7 </style> | 8 </style> |
8 <div id="nocalc" class="test"></div> | 9 <div id="nocalc" class="test"></div> |
9 <div id="calc" class="test"></div> | 10 <div id="calc" class="test"></div> |
10 <script> | 11 <script> |
11 descriptionQuiet("Tests that zooming a calc expression containing 'em' units w
orks correctly"); | 12 descriptionQuiet("Tests that zooming a calc expression containing 'em' units w
orks correctly"); |
12 zoomLevels = [0.67, 0.75, 0.9, 1, 1.1, 1.25, 1.5, 1.75, 2, 1]; | 13 zoomLevels = [0.67, 0.75, 0.9, 1, 1.1, 1.25, 1.5, 1.75, 2, 1]; |
13 calc = document.getElementById("calc"); | 14 calc = document.getElementById("calc"); |
14 nocalc = document.getElementById("nocalc"); | 15 nocalc = document.getElementById("nocalc"); |
15 for (var z = 0; z < zoomLevels.length; z++) { | 16 for (var z = 0; z < zoomLevels.length; z++) { |
16 var zoom = zoomLevels[z]; | 17 var zoom = zoomLevels[z]; |
17 document.body.style.zoom = zoom; | 18 document.body.style.zoom = zoom; |
18 | 19 |
19 shouldBe(calc.offsetWidth + "", nocalc.offsetWidth + "", true); | 20 shouldBe(calc.offsetWidth + "", nocalc.offsetWidth + "", true); |
20 } | 21 } |
21 </script> | 22 </script> |
OLD | NEW |