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

Side by Side Diff: LayoutTests/fast/css/font-face-css-change-while-loading.html

Issue 321403003: Notify font loads via FontLoader (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/fast/css/font-face-css-change-while-loading-expected.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <style id="sheet">
3 @font-face {
4 font-family: myahem;
5 src: url(../../resources/Ahem.ttf);
6 }
7 </style>
8 <script>
9 if (window.testRunner)
10 window.testRunner.waitUntilDone();
11
12 function getDocumentFontFaces() {
13 var faces = [];
14 document.fonts.forEach(function(face) { faces.push(face); });
15 return faces;
16 }
17
18 function runTest() {
19 var face = getDocumentFontFaces()[0];
20
21 document.getElementById("t").style.fontFamily = "myahem";
22 document.body.offsetTop; // force recalc and start loading font.
23
24 var newStyle = document.createElement("style");
25 newStyle.innerHTML = "#dummy { color: red; }";
26 var referenceNode = document.getElementById("sheet");
27 referenceNode.parentNode.insertBefore(newStyle, referenceNode);
28
29 face.loaded.then(finish);
30 }
31
32 function finish() {
33 if (window.testRunner)
34 window.testRunner.notifyDone();
35 }
36
37 onload = function() {
38 setTimeout(runTest, 0);
39 }
40 </script>
41 <p>You should see a black rectangle below.</p>
42 <div id="t">FAIL</div>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/css/font-face-css-change-while-loading-expected.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698