This is element x. It has inline style border: 1px solid #cc0000.
Element y is the test style sheet.
alert(document.styleSheets.length);
Should be 2
alert(y.cssRules.length);
Should be undefined (it’s an @import rule).
alert(y.cssRules[0].selectorText);
Should be p#test,ul.
alert(y.cssRules[y.cssRules.length-1].selectorText);
Should be 2
alert(y.rules.length);
Should be undefined (it’s an @import rule).
alert(y.rules[0].selectorText);
Should be p#test,ul.
alert(y.rules[y.rules.length-1].selectorText);
alert(y.imports.length);