Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/css/fontfaceset-ready.html

Issue 2722493002: FontFaceSet.ready should not be resolved if there's pending layouts (Closed)
Patch Set: add comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | third_party/WebKit/Source/core/css/FontFaceSet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698