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

Side by Side Diff: LayoutTests/fast/css/fontloader-css-change-in-callback.html

Issue 23717059: [Font Load Events] Implement FontFaceSet methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../js/resources/js-test-pre.js"></script> 3 <script src="../js/resources/js-test-pre.js"></script>
4 <style> 4 <style>
5 @font-face { 5 @font-face {
6 font-family: 'ahem'; 6 font-family: 'ahem';
7 src: url(../../resources/Ahem.ttf); 7 src: url(../../resources/Ahem.ttf);
8 } 8 }
9 </style> 9 </style>
10 <script> 10 <script>
11 description('Checks that adding CSS in callback of fonts.loadFont() does not cau se a crash.'); 11 description('Checks that adding CSS in callback of fonts.loadFont() does not cau se a crash.');
12 12
13 window.jsTestIsAsync = true; 13 window.jsTestIsAsync = true;
14 14
15 function addCss() { 15 function addCss() {
16 var cssText = "@font-face { font-family: 'Courier New'; src: local('Courier New') }"; 16 var cssText = "@font-face { font-family: 'Courier New'; src: local('Courier New') }";
17 var cssNode = document.createElement('style'); 17 var cssNode = document.createElement('style');
18 cssNode.type = 'text/css'; 18 cssNode.type = 'text/css';
19 var head = document.getElementsByTagName('head')[0]; 19 var head = document.getElementsByTagName('head')[0];
20 head.appendChild(cssNode); 20 head.appendChild(cssNode);
21 var cssTextNode = document.createTextNode(cssText); 21 var cssTextNode = document.createTextNode(cssText);
22 cssNode.appendChild(cssTextNode); 22 cssNode.appendChild(cssTextNode);
23 finishJSTest(); 23 finishJSTest();
24 } 24 }
25 25
26 if (document.fonts) 26 if (document.fonts)
27 document.fonts.loadFont({font:"12px ahem", onsuccess:addCss}) 27 document.fonts.load("12px ahem").then(addCss);
28 else { 28 else {
29 testFailed('document.fonts does not exist'); 29 testFailed('document.fonts does not exist');
30 finishJSTest(); 30 finishJSTest();
31 } 31 }
32 </script> 32 </script>
33 </head> 33 </head>
34 <body> 34 <body>
35 <script src="../js/resources/js-test-post.js"></script> 35 <script src="../js/resources/js-test-post.js"></script>
36 </body> 36 </body>
37 </html> 37 </html>
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/fontface-properties.html ('k') | LayoutTests/fast/css/fontloader-download-error.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698