Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / cssom / stylesheetlist-01.html
blob1f621f5e9c0064851b6e36ef258d7005b519bf7e
1 <!DOCTYPE html>
2 <html>
3 <head>
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>
12 <script>
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");
20 onload = function(){
22 var count = document.styleSheets.length;
24 initialTest.step(function(){
25 assert_equals(count, 5);
26 });
27 initialTest.done();
29 var i;
31 for (i=0; i<5; i++)
32 document.getElementById("s"+(i+1)).disabled = true;
34 colorTest.step(function(){
35 for (i=0; i<5; i++)
36 assert_equals(getComputedStyle(document.getElementById("e"+(i+1))).color, "rgb(0, 128, 0)");
37 });
38 colorTest.done();
40 count = document.styleSheets.length;
41 for (i=0; i<count; i++)
42 testObj[document.styleSheets[i].ownerNode.id] = true;
44 for (i=0; i<5; i++) {
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");
48 testObj[i].done();
51 </script>
52 </head>
53 <body>
54 <div id="log"></div>
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>
61 </div>
62 </body>
63 </html>