summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/link-multiple-error-events.html
blob: 9d112e88d135c02c2cd539c26154095fe2cd9b33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!DOCTYPE html>
<link rel="author" title="Dom Farolino" href="mailto:dom@chromium.org">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-link-element">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link id=style_link rel=stylesheet>
<script>
  async_test(t => {
    const link = document.querySelector('#style_link');
    link.onload = t.unreached_func('Sheet should fail to load');
    link.onerror = t.step_func(() => {
      link.onerror = t.step_func_done(() => {});
      link.href = 'nonexistent.css?second';
    });

    link.href = 'nonexistent.css?first';
  }, "Check if the <link>'s error event fires for each stylesheet it fails to load");

  </script>
</head>
</html>