| <!DOCTYPE html> |
| <style> |
| @font-face { |
| font-family: 'Ahem'; |
| src: url(../../resources/Ahem.ttf); |
| font-style: italic; |
| font-weight: 300; |
| unicode-range: U+0-3FF; |
| font-variant: small-caps; |
| font-display: block; |
| font-stretch: expanded; |
| } |
| </style> |
| <script src="../../resources/testharness.js"></script> |
| <script src="../../resources/testharnessreport.js"></script> |
| <script> |
| test(() => { |
| var fontFace = document.styleSheets[0].rules[0]; |
| assert_true(fontFace instanceof CSSFontFaceRule); |
| var cssText = 'font-family: Ahem; src: url("../../resources/Ahem.ttf"); font-style: italic; font-weight: 300; unicode-range: U+0-3FF; font-variant: small-caps; font-display: block; font-stretch: expanded;'; |
| assert_equals(fontFace.cssText, '@font-face { ' + cssText + ' }', 'Rule cssText'); |
| assert_equals(fontFace.style.cssText, cssText, 'style cssText'); |
| }, 'Calling cssText() on an @font-face rule serializes the contents.'); |
| </script> |