Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / font-load-while-styleresolver-missing.html
blob5068b391cb4dddec750a78f98d1f67f740587808
1 <!DOCTYPE html>
2 <style id='second'>
3 #limited {
4 color: green;
6 </style>
7 <script>
8 if (window.testRunner)
9 testRunner.waitUntilDone();
11 function runTest() {
12 // Create font-face
13 var font = new FontFace('myahem', 'url(../../resources/Ahem.ttf)', {});
14 document.fonts.add(font);
16 // Create dummy stylesheet. StyleInvalidationAnalysis will find
17 // that no setNeedsStyleRecalc is required.
18 var newStyle = document.createElement('style');
19 newStyle.innerHTML = '#dummy { color: red; }';
21 // Wait until scheduled styleRecalc is finished.
23 setTimeout(function() {
24 // Insert a new StyleSheet to invoke clearStyleResolver.
25 var referenceNode = document.getElementById('second');
26 referenceNode.parentNode.insertBefore(newStyle, referenceNode);
27 // Load a font while StyleResolver is missing.
28 font.load();
30 // Wait until scheduled styleRecalc is finished.
31 setTimeout(function() {
32 if (window.testRunner)
33 testRunner.notifyDone();
34 }, 0);
35 }, 0);
38 onload = function() {
39 // Need to runTest when document.parsing is false.
40 setTimeout(runTest, 0);
42 </script>
43 <div id='limited'></div>
44 <div style='font-family: myahem'>
45 Test for crbug.com/369401: if fonts are loaded while StyleResolver is missing, the fonts are not rendered.
46 </div>