I do not think there is a recommended test, but I just wrote it and I recommend it
var is_scoped = (function(s) {
s.setAttribute('scoped', 'true');
return !!s.scoped;
})(document.createElement('style'));
to be used as
if ( is_scoped ) {
}
Fiddle
Currently, style areas are only supported in the latest Firefox.
It is written a little more verbose, it is easier to see what is happening
var style = document.createElement('style');
style.setAttribute('scoped', 'true');
var is_scoped = style.scoped === true;
scoped true.
, , , style.scope true , , undefined.
, scoped.