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

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

Issue 1313853003: CSS Font Loading: FontFaceSet.ready should return the same promise each time (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | Source/core/css/FontFaceSet.h » ('j') | Source/core/css/FontFaceSet.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>FontFaceSet.ready attribute</title>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <script>
6
7 promise_test(function(t) {
8 assert_equals(document.fonts.ready, document.fonts.ready,
9 'FontFaceSet.ready should return the same promise');
10
11 var face = new FontFace('test', 'url(../../resources/Ahem.ttf)');
12
13 return document.fonts.ready
14 .then(function(fonts) {
15 assert_equals(fonts, document.fonts,
16 'FontFaceSet.ready should be resolved with the FontFac eSet');
17
18 var oldReady = document.fonts.ready;
19 document.fonts.add(face);
20 face.load();
21 var newReady = document.fonts.ready;
dominicc (has gone to gerrit) 2015/09/02 00:14:06 Exactly when does document.fonts.ready get reset?
Kunihiko Sakamoto 2015/09/02 05:05:42 That is when face.load() is called. Added another
22 assert_not_equals(newReady, oldReady,
dominicc (has gone to gerrit) 2015/09/02 00:14:06 Because resetting [[ReadyPromise]] happens at the
Kunihiko Sakamoto 2015/09/02 05:05:41 Done.
23 'FontFaceSet.ready should be replaced when a FontF ace in it started loading');
24 return newReady;
25 }).then(function(fonts) {
26 assert_equals(face.status, 'loaded',
27 'FontFaceSet.ready should be resolved after all fonts have been loaded');
28 });
29 }, 'FontFaceSet.ready attribute');
30
31 </script>
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/FontFaceSet.h » ('j') | Source/core/css/FontFaceSet.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698