font-face-009.html (1064B)
1 <!doctype html> 2 <title>CSS Test: @font-face from shadow applies to :host::before/::after.</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <link rel="author" title="Alan Stearns" href="mailto:stearns@adobe.com"> 6 <link rel="help" href="https://drafts.csswg.org/css-scoping/#shadow-names"> 7 8 <style> 9 #host { 10 float: left; 11 } 12 </style> 13 <div id="host"></div> 14 <script> 15 promise_test(async () => { 16 host.attachShadow({ mode: "open" }).innerHTML = ` 17 <style> 18 @font-face { 19 font-family: ff-16-wide; 20 src: url(/fonts/Ahem.ttf); 21 } 22 :host::before, :host::after { 23 font-family: ff-16-wide; 24 content: "12345" 25 } 26 </style> 27 <slot></slot> 28 `; 29 30 await document.fonts.ready; 31 32 //shrinkwrapped size for a default font will be a bit more than 80-90 33 //if the font is applied, it will be a bit more than 160 34 assert_greater_than(document.getElementById('host').offsetWidth, 160); 35 }, "@font-face from shadow applies to to :host::before/::after."); 36 </script>