Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / HTMLStyleElement / programmatically-add-style-with-onload-handler.html
blob30dd2b743064c2e988e6ee56f82d84e1877db7f8
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../HTMLLinkElement/resources/link-load-utilities.js"></script>
5 </head>
6 <body>
7 <p>This tests that a Load event is fired at a programmatically inserted HTML Style element once it loads its style sheet. This test PASSED if you see the word PASS below. Otherwise, it FAILED.</p>
8 <pre id="console"></pre>
9 <script>
10 var style = createStyleElementWithString("");
11 style.onload = function () { testPassedAndNotifyDone('Fired Load event.') };
12 style.onerror = function () { testFailedAndNotifyDone('Fired Error event. Should have fired Load event.') };
13 document.head.appendChild(style);
14 </script>
15 </body>
16 </html>