| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>FontFaceSet.ready attribute</title> | 2 <title>FontFaceSet.ready attribute</title> |
| 3 <script src="../../resources/testharness.js"></script> | 3 <script src="../../resources/testharness.js"></script> |
| 4 <script src="../../resources/testharnessreport.js"></script> | 4 <script src="../../resources/testharnessreport.js"></script> |
| 5 <div style="font-family: ahem">A</div> |
| 5 <script> | 6 <script> |
| 6 | 7 |
| 7 promise_test(function(t) { | 8 promise_test(function(t) { |
| 8 assert_equals(document.fonts.ready, document.fonts.ready, | 9 assert_equals(document.fonts.ready, document.fonts.ready, |
| 9 'FontFaceSet.ready should return the same promise'); | 10 'FontFaceSet.ready should return the same promise'); |
| 10 | 11 |
| 11 var face = new FontFace('test', 'url(../../resources/Ahem.ttf)'); | 12 var face = new FontFace('test', 'url(../../resources/Ahem.ttf)'); |
| 12 | 13 |
| 13 return document.fonts.ready | 14 return document.fonts.ready |
| 14 .then(function(fonts) { | 15 .then(function(fonts) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 29 'FontFaceSet.status after calling load() on a FontFace
in it'); | 30 'FontFaceSet.status after calling load() on a FontFace
in it'); |
| 30 return newReady; | 31 return newReady; |
| 31 }).then(function(fonts) { | 32 }).then(function(fonts) { |
| 32 assert_equals(face.status, 'loaded', | 33 assert_equals(face.status, 'loaded', |
| 33 'FontFaceSet.ready should be resolved after all fonts
have been loaded'); | 34 'FontFaceSet.ready should be resolved after all fonts
have been loaded'); |
| 34 assert_equals(document.fonts.status, 'loaded', | 35 assert_equals(document.fonts.status, 'loaded', |
| 35 'FontFaceSet.status after FontFaceSet.ready is resolve
d'); | 36 'FontFaceSet.status after FontFaceSet.ready is resolve
d'); |
| 36 }); | 37 }); |
| 37 }, 'FontFaceSet.ready attribute'); | 38 }, 'FontFaceSet.ready attribute'); |
| 38 | 39 |
| 40 promise_test(function(t) { |
| 41 var face = new FontFace('ahem', 'url(../../resources/Ahem.ttf)'); |
| 42 |
| 43 return document.fonts.ready |
| 44 .then(function(fonts) { |
| 45 document.fonts.add(face); |
| 46 return document.fonts.ready; |
| 47 }).then(function(fonts) { |
| 48 assert_equals(face.status, 'loaded'); |
| 49 }); |
| 50 }, 'FontFaceSet.ready should be resolved after layout operations which may cause
font loads.'); |
| 51 |
| 39 </script> | 52 </script> |
| OLD | NEW |