blob: 3f73f213adf3afb8581206fa62d2045c9a2d4f94 (
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>
<html>
<head>
<link rel=match href="shadow-style-invalidation-vw-units-ref.html">
<meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
</head>
<body>
<script>
const iframe = document.createElement('iframe');
iframe.scrolling = 'no';
iframe.style = 'border: none; width: 50px; height: 50px; overflow: hidden';
iframe.src = `data:text/html,<!DOCTYPE html><style>head,html,body { padding: 0; margin: 0; }</style>
<div style="width: 100vw; height: 50vw; background: green"></div>
<div style="width: 100px; height: 100px; background: red;"><div id="host"></div></div>
<script>host.attachShadow({mode: 'closed'}).innerHTML =
'<style> div { width: 100vw; height: 50vw; background: green; }</style><div></div>';
host.getBoundingClientRect();
</sc` + `ript>`;
iframe.onload = () => {
iframe.style.width = '100px';
iframe.style.height = '100px';
}
document.body.appendChild(iframe);
</script>
</body>
</html>
|