file_report_font_cache-2.html (732B)
1 <!DOCTYPE html> 2 <style> 3 @font-face { 4 font-family: "CSP Report Test Font 1"; 5 src: url(Ahem.ttf?report_font_cache-1); 6 } 7 @font-face { 8 font-family: "CSP Report Test Font 3"; 9 src: url(Ahem.ttf?report_font_cache-3); 10 } 11 p { margin-right: 1ex; } /* cause cached CSP check to happen OMT (due to 12 font metrics lookup) */ 13 .x { font: 24px "CSP Report Test Font 1"; } 14 .y { font: 24px "CSP Report Test Font 3"; } 15 </style> 16 <p class="x">A</p> 17 <script> 18 // First flush should dispatch the "Test Font 1" report that is stored 19 // in the user font cache. 20 document.body.offsetWidth; 21 22 // Second flush should dispatch "Test Font 3" report. 23 document.querySelector("p").className = "y"; 24 document.body.offsetWidth; 25 </script>