Wed, 31 Dec 2014 13:27:57 +0100
Ignore runtime configuration files generated during quality assurance.
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html lang="en"> |
michael@0 | 3 | <!-- |
michael@0 | 4 | https://bugzilla.mozilla.org/show_bug.cgi?id=401046 |
michael@0 | 5 | --> |
michael@0 | 6 | <head> |
michael@0 | 7 | <title>Test for Bug 401046</title> |
michael@0 | 8 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
michael@0 | 9 | <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 10 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
michael@0 | 11 | <style type="text/css"> |
michael@0 | 12 | |
michael@0 | 13 | #display span { margin-bottom: 1em; } |
michael@0 | 14 | |
michael@0 | 15 | </style> |
michael@0 | 16 | </head> |
michael@0 | 17 | <body> |
michael@0 | 18 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=401046">Mozilla Bug 401046</a> |
michael@0 | 19 | <p id="display" lang="zh-Hans"> |
michael@0 | 20 | <span id="s0" style="font-size: 0">汉字</span> |
michael@0 | 21 | <span id="s4" style="font-size: 4px">汉字</span> |
michael@0 | 22 | <span id="s12" style="font-size: 12px">汉字</span> |
michael@0 | 23 | <span id="s28" style="font-size: 28px">汉字</span> |
michael@0 | 24 | </p> |
michael@0 | 25 | <div id="content" style="display: none"> |
michael@0 | 26 | |
michael@0 | 27 | </div> |
michael@0 | 28 | <pre id="test"> |
michael@0 | 29 | <script class="testbody" type="text/javascript"> |
michael@0 | 30 | |
michael@0 | 31 | /** Test for Bug 401046 **/ |
michael@0 | 32 | |
michael@0 | 33 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 34 | |
michael@0 | 35 | var elts = [ |
michael@0 | 36 | document.getElementById("s0"), |
michael@0 | 37 | document.getElementById("s4"), |
michael@0 | 38 | document.getElementById("s12"), |
michael@0 | 39 | document.getElementById("s28") |
michael@0 | 40 | ]; |
michael@0 | 41 | |
michael@0 | 42 | function fs(idx) { |
michael@0 | 43 | // The computed font size actually *doesn't* currently reflect the |
michael@0 | 44 | // minimum font size preference, but things in em units do. Not sure |
michael@0 | 45 | // if this is how it ought to be... |
michael@0 | 46 | return getComputedStyle(elts[idx], "").marginBottom; |
michael@0 | 47 | } |
michael@0 | 48 | |
michael@0 | 49 | SpecialPowers.pushPrefEnv({'clear': [['font.minimum-size.zh-CN']]}, step1); |
michael@0 | 50 | |
michael@0 | 51 | function step1() { |
michael@0 | 52 | is(fs(0), "0px", "at min font size 0, 0px should compute to 0px"); |
michael@0 | 53 | is(fs(1), "4px", "at min font size 0, 4px should compute to 4px"); |
michael@0 | 54 | is(fs(2), "12px", "at min font size 0, 12px should compute to 12px"); |
michael@0 | 55 | is(fs(3), "28px", "at min font size 0, 28px should compute to 28px"); |
michael@0 | 56 | |
michael@0 | 57 | SpecialPowers.pushPrefEnv({'set': [['font.minimum-size.zh-CN', 7]]}, step2); |
michael@0 | 58 | } |
michael@0 | 59 | |
michael@0 | 60 | function step2() { |
michael@0 | 61 | is(fs(0), "0px", "at min font size 7, 0px should compute to 0px"); |
michael@0 | 62 | is(fs(1), "7px", "at min font size 7, 4px should compute to 7px"); |
michael@0 | 63 | is(fs(2), "12px", "at min font size 7, 12px should compute to 12px"); |
michael@0 | 64 | is(fs(3), "28px", "at min font size 7, 28px should compute to 28px"); |
michael@0 | 65 | |
michael@0 | 66 | SpecialPowers.pushPrefEnv({'set': [['font.minimum-size.zh-CN', 18]]}, step3); |
michael@0 | 67 | } |
michael@0 | 68 | |
michael@0 | 69 | function step3() { |
michael@0 | 70 | is(fs(0), "0px", "at min font size 18, 0px should compute to 0px"); |
michael@0 | 71 | is(fs(1), "18px", "at min font size 18, 4px should compute to 18px"); |
michael@0 | 72 | is(fs(2), "18px", "at min font size 18, 12px should compute to 18px"); |
michael@0 | 73 | is(fs(3), "28px", "at min font size 18, 28px should compute to 28px"); |
michael@0 | 74 | |
michael@0 | 75 | SpecialPowers.pushPrefEnv({'clear': [['font.minimum-size.zh-CN']]}, SimpleTest.finish); |
michael@0 | 76 | } |
michael@0 | 77 | |
michael@0 | 78 | </script> |
michael@0 | 79 | </pre> |
michael@0 | 80 | </body> |
michael@0 | 81 | </html> |
michael@0 | 82 |