2 <script src=
"../../resources/js-test.js"></script>
10 <span id=
"text" style=
"font-family: Test; font-weight: 700;">Test Text
</span>
12 description('Tests that adding a FontFace to existing family triggers font update.');
14 window
.jsTestIsAsync
= true;
16 var widthBeforeLoad
, widthAfterLoad
;
18 document
.fonts
.ready
.then(function() {
19 widthBeforeLoad
= document
.getElementById('text').offsetWidth
;
20 var face
= new FontFace('Test', 'url(../../resources/Ahem.ttf)', { weight
: 700 });
21 document
.fonts
.add(face
);
24 widthAfterLoad
= document
.getElementById('text').offsetWidth
;
25 shouldBeTrue('widthBeforeLoad != widthAfterLoad');