зеркало из https://github.com/mozilla/gecko-dev.git
16 строки
397 B
HTML
16 строки
397 B
HTML
<!DOCTYPE html>
|
|
<body>
|
|
<style>
|
|
body { color: red; }
|
|
</style>
|
|
<script>
|
|
var div = document.createElement("div");
|
|
var shadow = div.attachShadow({ mode: "open" });
|
|
shadow.innerHTML = '<p>This should be green.</p>';
|
|
document.body.appendChild(div);
|
|
shadow.firstChild.offsetTop;
|
|
var style = document.createElement("style");
|
|
style.textContent = 'p { color: green; }';
|
|
shadow.appendChild(style);
|
|
</script>
|