Source code
Revision control
Copy as Markdown
Other Tools
<!doctype html>
<meta charset=utf-8>
<title>Reference: shared-stylesheet background image renders</title>
<style>
html, body { margin: 0; }
iframe { border: none; width: 100px; height: 100px; display: block; }
</style>
<script>document.documentElement.classList.add('reftest-wait');</script>
<body></body>
<script>
'use strict';
// A permissive (no-CSP) document renders the shared background image, i.e. a
// green box. This is the expected result once the image has loaded.
const permissive = document.createElement('iframe');
permissive.src = 'support/shared-stylesheet-image-cache-bypass-permissive.html';
window.addEventListener('message', e => {
if (e.source === permissive.contentWindow && e.data === 'ready') {
requestAnimationFrame(() => requestAnimationFrame(() => {
document.documentElement.classList.remove('reftest-wait');
}));
}
});
document.body.appendChild(permissive);
</script>