summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/quirks/class-names-across-iframes.html
blob: a40a0e9dc5323001d2f32175680bf552c0de4742 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<link rel="match" href="class-names-across-iframes-ref.html" />
<html>
<title>Verifies matching of class names across iframes with/without quirks</title>
<body>
<template><p class="Testing">text that should be green</p></template>

<script>
  /*
    This test is a regression test for a bug in chrome. See
    https://crbug.com/1474382. It triggers quirks mode in the iframe
    and then exits quirks mode.
    */
  const iframe = document.createElement('iframe');
  document.body.append(iframe);

  const doc = iframe.contentWindow.document;

  const data = document.querySelector('template').innerHTML;
  const body = doc.createElement('body');
  body.innerHTML = data;

  doc.open();
  doc.write(`<!DOCTYPE html><html><head><style>p.Testing{color:green;}</style></head><body>${data}</body></html>`);
  doc.close();
</script>
</body>
</html>