OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <script src="../../resources/js-test.js"></script> |
| 3 <style> |
| 4 @font-face { |
| 5 font-family: font1; |
| 6 src: local(Arial); |
| 7 } |
| 8 @font-face { |
| 9 font-family: font2; |
| 10 src: local(Arial); |
| 11 } |
| 12 </style> |
| 13 <script> |
| 14 description('Tests iterators of FontFaceSet.'); |
| 15 |
| 16 var font3 = new FontFace('font3', 'local(Arial)'); |
| 17 document.fonts.add(font3); |
| 18 |
| 19 var expected = ['font1', 'font2', 'font3']; |
| 20 var families; |
| 21 |
| 22 families = []; |
| 23 for (var face of document.fonts) { |
| 24 families.push(face.family); |
| 25 } |
| 26 shouldBeEqualToString("families.join(',')", expected.join(',')); |
| 27 |
| 28 families = []; |
| 29 for (var face of document.fonts.keys()) { |
| 30 families.push(face.family); |
| 31 } |
| 32 shouldBeEqualToString("families.join(',')", expected.join(',')); |
| 33 |
| 34 families = []; |
| 35 for (var face of document.fonts.values()) { |
| 36 families.push(face.family); |
| 37 } |
| 38 shouldBeEqualToString("families.join(',')", expected.join(',')); |
| 39 |
| 40 families = []; |
| 41 for (var entry of document.fonts.entries()) { |
| 42 shouldBeTrue('entry[0] === entry[1]'); |
| 43 families.push(entry[0].family); |
| 44 } |
| 45 shouldBeEqualToString("families.join(',')", expected.join(',')); |
| 46 |
| 47 </script> |
OLD | NEW |