4 <title>Stylesheets not removed from StyleSheetList when disabled
</title>
5 <script src=
"../resources/testharness.js"></script>
6 <script src=
"../resources/testharnessreport.js"></script>
7 <link id=
"s1" rel=
"stylesheet" title=
"set" href=
"data:text/css,#e1{color:red}">
8 <link id=
"s2" rel=
"alternate stylesheet" type=
"text/css" title=
"set" href=
"data:text/css,#e2{color:red}">
9 <link id=
"s3" rel=
"stylesheet" type=
"text/css" href=
"data:text/css,#e3{color:red}">
10 <style id=
"s4">#e4{color:red}
</style>
11 <style id=
"s5" title=
"set">#e5{color:red}
</style>
13 var initialTest
= async_test("Check that all stylesheets are initially present in document.styleSheets");
14 var colorTest
= async_test("Check that no stylesheets are applied when disabled");
15 var testObj
= new Object
;
16 for (var i
=0; i
<5; i
++) {
17 testObj
[i
] = async_test("#s"+(i
+1)+" accessible through document.styleSheets after disabling");
22 var count
= document
.styleSheets
.length
;
24 initialTest
.step(function(){
25 assert_equals(count
, 5);
32 document
.getElementById("s"+(i
+1)).disabled
= true;
34 colorTest
.step(function(){
36 assert_equals(getComputedStyle(document
.getElementById("e"+(i
+1))).color
, "rgb(0, 128, 0)");
40 count
= document
.styleSheets
.length
;
41 for (i
=0; i
<count
; i
++)
42 testObj
[document
.styleSheets
[i
].ownerNode
.id
] = true;
45 testObj
[i
].step(function(){
46 assert_true(testObj
["s"+(i
+1)]);
47 }, "Check if #s"+(i
+1)+" is present in document.styleSheets after it is disabled");
55 <div style=
"color: green">
56 <span id=
"e1">This
</span>
57 <span id=
"e2">text
</span>
58 <span id=
"e3">should
</span>
59 <span id=
"e4">be
</span>
60 <span id=
"e5">green
</span>