Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / font-face-add-same-family-later.html
blob253fed962aae28e9b0ecda54ef1649b12c4de04c
1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script>
3 <style>
4 @font-face {
5 font-family: Test;
6 font-weight: 400;
7 src: local(Times);
9 </style>
10 <span id="text" style="font-family: Test; font-weight: 700;">Test Text</span>
11 <script>
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);
22 return face.loaded;
23 }).then(function() {
24 widthAfterLoad = document.getElementById('text').offsetWidth;
25 shouldBeTrue('widthBeforeLoad != widthAfterLoad');
26 finishJSTest();
27 });
28 </script>