This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
I think it would be good to reflect in a StyleSheet object whether it is scoped to an element (via a scoped="" attribute on a <style> element). Might also be worth exposing what the scope root is.
Needs to be coordinated with bug 19874.
Can you elaborate on the use case(s), please? It's possible to find this out already, something like StyleSheet.prototype.isScoped = function() { return this.ownerNode && !!this.ownerNode.scoped; }; StyleSheet.prototype.scopedElement = function() { if (this.isScoped()) { return this.ownerNode.parentElement; } }; This isn't fool-proof, but probably good enough. Since scoped style sheets aren't widely implemented yet, I think it's a bit premature to add this to CSSOM. Let's revisit this when scoped style sheets are widely implemented and used.
I am not sure what use case I had in mind when I filed the bug. :) I didn't know about ownerNode. Having .scoped on the StyleSheet object is not so necessary given that.
OK, then I'll mark this as WONTFIX. Feel free to reopen if anyone comes up with a use case.