| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <style> | 4 <style> |
| 5 @font-face { | 5 @font-face { |
| 6 font-family: "foobar"; | 6 font-family: "foobar"; |
| 7 src: local("foobar"); | 7 src: local("foobar"); |
| 8 } | 8 } |
| 9 div { | 9 div { |
| 10 font-family: "foobar"; | 10 font-family: "foobar"; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 function checkFontStyleValue() { | 29 function checkFontStyleValue() { |
| 30 var before = e.style.getPropertyValue('font'); | 30 var before = e.style.getPropertyValue('font'); |
| 31 e.style.font = ''; | 31 e.style.font = ''; |
| 32 e.style.font = before; | 32 e.style.font = before; |
| 33 return (e.style.getPropertyValue('font') === before); | 33 return (e.style.getPropertyValue('font') === before); |
| 34 } | 34 } |
| 35 | 35 |
| 36 style.fontSize = "20px"; | 36 style.fontSize = "20px"; |
| 37 // We need at least the font-family to build the shorthand. | 37 // We need at least the font-family to build the shorthand. |
| 38 shouldBe("style.font", "''"); | 38 shouldBe("style.font", "''"); |
| 39 shouldBe("computedStyle.font", "'normal normal normal 20px/normal foobar'"); | 39 shouldBe("computedStyle.font", "'normal normal normal normal 20px/normal foobar'
"); |
| 40 shouldBe("computedStyle.fontSize", "'20px'"); | 40 shouldBe("computedStyle.fontSize", "'20px'"); |
| 41 shouldBe("checkFontStyleValue()", "true"); | 41 shouldBe("checkFontStyleValue()", "true"); |
| 42 | 42 |
| 43 style.fontSize = "20px"; | 43 style.fontSize = "20px"; |
| 44 style.fontFamily = "sans-serif"; | 44 style.fontFamily = "sans-serif"; |
| 45 shouldBe("style.font", "'20px sans-serif'"); | 45 shouldBe("style.font", "'20px sans-serif'"); |
| 46 shouldBe("computedStyle.font", "'normal normal normal 20px/normal sans-serif'"); | 46 shouldBe("computedStyle.font", "'normal normal normal normal 20px/normal sans-se
rif'"); |
| 47 shouldBe("computedStyle.fontFamily", "'sans-serif'"); | 47 shouldBe("computedStyle.fontFamily", "'sans-serif'"); |
| 48 shouldBe("checkFontStyleValue()", "true"); | 48 shouldBe("checkFontStyleValue()", "true"); |
| 49 | 49 |
| 50 style.fontStyle = "italic"; | 50 style.fontStyle = "italic"; |
| 51 shouldBe("style.font", "'italic 20px sans-serif'"); | 51 shouldBe("style.font", "'italic 20px sans-serif'"); |
| 52 shouldBe("computedStyle.font", "'italic normal normal 20px/normal sans-serif'"); | 52 shouldBe("computedStyle.font", "'italic normal normal normal 20px/normal sans-se
rif'"); |
| 53 shouldBe("computedStyle.fontStyle", "'italic'"); | 53 shouldBe("computedStyle.fontStyle", "'italic'"); |
| 54 shouldBe("checkFontStyleValue()", "true"); | 54 shouldBe("checkFontStyleValue()", "true"); |
| 55 | 55 |
| 56 style.fontVariant = "small-caps"; | 56 style.fontVariant = "small-caps"; |
| 57 shouldBe("style.font", "'italic small-caps 20px sans-serif'"); | 57 shouldBe("style.font", "'italic small-caps 20px sans-serif'"); |
| 58 shouldBe("computedStyle.font", "'italic small-caps normal 20px/normal sans-serif
'"); | 58 shouldBe("computedStyle.font", "'italic small-caps normal normal 20px/normal san
s-serif'"); |
| 59 shouldBe("computedStyle.fontVariant", "'small-caps'"); | 59 shouldBe("computedStyle.fontVariant", "'small-caps'"); |
| 60 shouldBe("checkFontStyleValue()", "true"); | 60 shouldBe("checkFontStyleValue()", "true"); |
| 61 | 61 |
| 62 style.fontWeight = "bold"; | 62 style.fontWeight = "bold"; |
| 63 shouldBe("style.font", "'italic small-caps bold 20px sans-serif'"); | 63 shouldBe("style.font", "'italic small-caps bold 20px sans-serif'"); |
| 64 shouldBe("computedStyle.font", "'italic small-caps bold 20px/normal sans-serif'"
); | 64 shouldBe("computedStyle.font", "'italic small-caps bold normal 20px/normal sans-
serif'"); |
| 65 shouldBe("computedStyle.fontWeight", "'bold'"); | 65 shouldBe("computedStyle.fontWeight", "'bold'"); |
| 66 shouldBe("checkFontStyleValue()", "true"); | 66 shouldBe("checkFontStyleValue()", "true"); |
| 67 | 67 |
| 68 style.lineHeight = "40px"; | 68 style.lineHeight = "40px"; |
| 69 shouldBe("style.font", "'italic small-caps bold 20px/40px sans-serif'"); | 69 shouldBe("style.font", "'italic small-caps bold 20px/40px sans-serif'"); |
| 70 shouldBe("computedStyle.font", "'italic small-caps bold 20px/40px sans-serif'"); | 70 shouldBe("computedStyle.font", "'italic small-caps bold normal 20px/40px sans-se
rif'"); |
| 71 shouldBe("computedStyle.lineHeight", "'40px'"); | 71 shouldBe("computedStyle.lineHeight", "'40px'"); |
| 72 shouldBe("checkFontStyleValue()", "true"); | 72 shouldBe("checkFontStyleValue()", "true"); |
| 73 | 73 |
| 74 style.font = ""; | 74 style.font = ""; |
| 75 shouldBe("style.font", "''"); | 75 shouldBe("style.font", "''"); |
| 76 shouldBe("computedStyle.font", "'normal normal normal 16px/normal foobar'"); | 76 shouldBe("computedStyle.font", "'normal normal normal normal 16px/normal foobar'
"); |
| 77 shouldBe("checkFontStyleValue()", "true"); | 77 shouldBe("checkFontStyleValue()", "true"); |
| 78 | 78 |
| 79 style.fontWeight = "bold"; | 79 style.fontWeight = "bold"; |
| 80 // It is normal to return null as the font-size is mandatory to build the shorth
and. | 80 // It is normal to return null as the font-size is mandatory to build the shorth
and. |
| 81 shouldBe("style.font", "''"); | 81 shouldBe("style.font", "''"); |
| 82 shouldBe("computedStyle.font", "'normal normal bold 16px/normal foobar'"); | 82 shouldBe("computedStyle.font", "'normal normal bold normal 16px/normal foobar'")
; |
| 83 shouldBe("computedStyle.fontWeight", "'bold'"); | 83 shouldBe("computedStyle.fontWeight", "'bold'"); |
| 84 shouldBe("checkFontStyleValue()", "true"); | 84 shouldBe("checkFontStyleValue()", "true"); |
| 85 | 85 |
| 86 style.fontSize = "40px"; | 86 style.fontSize = "40px"; |
| 87 style.fontFamily = "sans-serif"; | 87 style.fontFamily = "sans-serif"; |
| 88 style.fontWeight = "bold"; | 88 style.fontWeight = "bold"; |
| 89 shouldBe("style.font", "'bold 40px sans-serif'"); | 89 shouldBe("style.font", "'bold 40px sans-serif'"); |
| 90 shouldBe("computedStyle.font", "'normal normal bold 40px/normal sans-serif'"); | 90 shouldBe("computedStyle.font", "'normal normal bold normal 40px/normal sans-seri
f'"); |
| 91 shouldBe("computedStyle.fontSize", "'40px'"); | 91 shouldBe("computedStyle.fontSize", "'40px'"); |
| 92 shouldBe("computedStyle.fontFamily", "'sans-serif'"); | 92 shouldBe("computedStyle.fontFamily", "'sans-serif'"); |
| 93 shouldBe("checkFontStyleValue()", "true"); | 93 shouldBe("checkFontStyleValue()", "true"); |
| 94 | 94 |
| 95 document.body.removeChild(testContainer); | 95 document.body.removeChild(testContainer); |
| 96 </script> | 96 </script> |
| 97 </body> | 97 </body> |
| 98 </html> | 98 </html> |
| OLD | NEW |