Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <html> | |
|
rune
2015/03/02 09:08:36
- Use <!DOCTYPE html>
- No html, head, or body tag
changseok
2015/03/02 15:57:48
Done.
| |
| 2 <head> | |
| 3 <script src="../../resources/js-test.js"></script> | |
| 4 <style> | |
| 5 div.container { | |
| 6 font-size: 200px; | |
| 7 line-height: 1; | |
| 8 } | |
| 9 | |
| 10 @font-face { | |
| 11 /* LinLibertine_R's aspect value = 0.440918 */ | |
| 12 font-family : 'referenceFont'; | |
| 13 src : url('../../third_party/Libertine/LinLibertine_R.woff') format("wof f"); | |
| 14 } | |
| 15 | |
| 16 @font-face { | |
| 17 /* OpenSans-Regular's aspect = 0.544922 */ | |
| 18 font-family : 'testFont'; | |
| 19 src : url('../../resources/opensans/OpenSans-Regular.woff') format("woff "); | |
| 20 } | |
| 21 | |
| 22 span.test { | |
| 23 font-family: testFont; | |
| 24 font-size-adjust: 0.440; | |
| 25 } | |
| 26 | |
| 27 span.reference { | |
| 28 font-family: referenceFont; | |
| 29 } | |
| 30 </style> | |
| 31 <script> | |
| 32 var testStyle; | |
| 33 var referenceStyle; | |
| 34 var containerStyle; | |
| 35 | |
| 36 function runTest() | |
| 37 { | |
| 38 description("font-size-adjust should affect neigther computed line-heigh t nor font-size."); | |
| 39 | |
| 40 var test = document.querySelector(".test"); | |
| 41 var reference = document.querySelector(".reference"); | |
| 42 var container = document.querySelector(".container"); | |
| 43 | |
| 44 testStyle = window.getComputedStyle(test, null); | |
| 45 referenceStyle = window.getComputedStyle(reference, null); | |
| 46 containerStyle = window.getComputedStyle(container, null); | |
| 47 | |
| 48 shouldEvaluateTo("parseFloat(testStyle.getPropertyValue('font-size-adjus t'))", 0.440, 0.0001); | |
| 49 shouldBeEqualToString("referenceStyle.getPropertyValue('font-size-adjust ')", 'none'); | |
| 50 | |
| 51 shouldBeEqualToString("testStyle.getPropertyValue('font-size')", referen ceStyle.getPropertyValue('font-size')); | |
| 52 shouldBeEqualToString("testStyle.getPropertyValue('line-height')", refer enceStyle.getPropertyValue('line-height')); | |
| 53 | |
| 54 shouldBeEqualToString("containerStyle.getPropertyValue('line-height')", referenceStyle.getPropertyValue('line-height')); | |
| 55 } | |
| 56 </script> | |
| 57 </head> | |
| 58 | |
| 59 <body onload="runTest()"> | |
| 60 <div class="container"> | |
| 61 <span class="test">x</span><span class="reference">x</span> | |
| 62 </div> | |
| 63 </body> | |
| 64 </html> | |
| OLD | NEW |