Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / fontfaceset-css-change-in-callback.html
blob28827ca0d5bed731a6f423dc60f83a48cc5969ec
1 <html>
2 <head>
3 <script src="../../resources/js-test.js"></script>
4 <style>
5 @font-face {
6 font-family: 'ahem';
7 src: url(../../resources/Ahem.ttf);
9 </style>
10 <script>
11 description('Checks that adding CSS in callback of fonts.loadFont() does not cause a crash.');
13 window.jsTestIsAsync = true;
15 function addCss() {
16 var cssText = "@font-face { font-family: 'Courier New'; src: local('Courier New') }";
17 var cssNode = document.createElement('style');
18 cssNode.type = 'text/css';
19 var head = document.getElementsByTagName('head')[0];
20 head.appendChild(cssNode);
21 var cssTextNode = document.createTextNode(cssText);
22 cssNode.appendChild(cssTextNode);
23 finishJSTest();
26 if (document.fonts)
27 document.fonts.load("12px ahem").then(addCss);
28 else {
29 testFailed('document.fonts does not exist');
30 finishJSTest();
32 </script>
33 </head>
34 <body>
35 </body>
36 </html>