Re: [w3c/webcomponents] Shadow DOM, <style>, and document.styleSheets (#56)

So it's rather messy actually. While `<style>.sheet` returns a stylesheet, `document.styleSheets` only returns the one from `<style>` in Firefox. Both Chrome and Safari have `document.styleSheets` empty, despite `<style>.sheet` returning a stylesheet.

No browser appears to load `@import` or cause that to create another stylesheet.

I used variations on this code in Live DOM Viewer:
```
<!DOCTYPE html>
<script>
 var d = document.implementation.createHTMLDocument();
 var s = d.createElement('style');
 s.textContent = '@import "style"';
 d.documentElement.childNodes[0].appendChild(s);
 w(s.sheet);
 w(s.sheet.cssRules[0].cssText);
 setTimeout("w(d.styleSheets.length)", 500)
</script> 
```

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/56#issuecomment-234483300

Received on Friday, 22 July 2016 08:22:00 UTC