| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <style type="text/css"> | 3 <style type="text/css"> |
| 4 .pass { color: green; } | 4 .pass { color: green; } |
| 5 .fail { color: red; } | 5 .fail { color: red; } |
| 6 </style> | 6 </style> |
| 7 <style type="text/css"> | 7 <style type="text/css"> |
| 8 .foo { color: black; } | 8 .foo { color: black; } |
| 9 @media screen { | 9 @media screen { |
| 10 .bar { color: blue; } | 10 .bar { color: blue; } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 testRunner.dumpAsText(); | 53 testRunner.dumpAsText(); |
| 54 | 54 |
| 55 var rules = document.styleSheets[1].cssRules; | 55 var rules = document.styleSheets[1].cssRules; |
| 56 | 56 |
| 57 var rule = rules[0]; | 57 var rule = rules[0]; |
| 58 var mediaRule = rules[1]; | 58 var mediaRule = rules[1]; |
| 59 var keyframesRule = rules[2]; | 59 var keyframesRule = rules[2]; |
| 60 var pageRule = rules[3]; | 60 var pageRule = rules[3]; |
| 61 var charsetRule = document.styleSheets[2].cssRules[0]; | 61 var charsetRule = document.styleSheets[2].cssRules[0]; |
| 62 var style = rule.style; | 62 var style = rule.style; |
| 63 var value = style.getPropertyCSSValue('color'); | |
| 64 var mediaList = mediaRule.media; | 63 var mediaList = mediaRule.media; |
| 65 | 64 |
| 66 var listing = [ | 65 var listing = [ |
| 67 { | 66 { |
| 68 type: 'CSSRule', | 67 type: 'CSSRule', |
| 69 elementToUse: rule, | 68 elementToUse: rule, |
| 70 attributes: [ | 69 attributes: [ |
| 71 // 'null' is not a valid rule, so the setter does nothi
ng. | 70 // 'null' is not a valid rule, so the setter does nothi
ng. |
| 72 {name: 'cssText', expectedNull: '.foo { color: black; }'
} | 71 {name: 'cssText', expectedNull: '.foo { color: black; }'
} |
| 73 ] | 72 ] |
| (...skipping 28 matching lines...) Expand all Loading... |
| 102 }, | 101 }, |
| 103 { | 102 { |
| 104 type: 'CSSStyleDeclaration', | 103 type: 'CSSStyleDeclaration', |
| 105 elementToUse: style, | 104 elementToUse: style, |
| 106 attributes: [ | 105 attributes: [ |
| 107 // cssText detects syntax errors, such as JS null, and s
ets the value to the empty string. | 106 // cssText detects syntax errors, such as JS null, and s
ets the value to the empty string. |
| 108 {name: 'cssText', expectedNull: ''} | 107 {name: 'cssText', expectedNull: ''} |
| 109 ] | 108 ] |
| 110 }, | 109 }, |
| 111 { | 110 { |
| 112 type: 'CSSValue', | |
| 113 elementToUse: value, | |
| 114 attributes: [ | |
| 115 // for now, setting cssText does not doing anything. Whe
n it gets implemented, the expectedNull | |
| 116 // should become the empty string. | |
| 117 {name: 'cssText', expectedNull: 'black'} | |
| 118 ] | |
| 119 }, | |
| 120 { | |
| 121 type: 'MediaList', | 111 type: 'MediaList', |
| 122 elementToUse: mediaList, | 112 elementToUse: mediaList, |
| 123 attributes: [ | 113 attributes: [ |
| 124 {name: 'mediaText', expectedNull: ''} | 114 {name: 'mediaText', expectedNull: ''} |
| 125 ] | 115 ] |
| 126 } | 116 } |
| 127 ]; | 117 ]; |
| 128 | 118 |
| 129 for (element in listing) { | 119 for (element in listing) { |
| 130 var type = listing[element].type; | 120 var type = listing[element].type; |
| 131 var elementToUse = listing[element].elementToUse; | 121 var elementToUse = listing[element].elementToUse; |
| 132 var attrs = listing[element].attributes; | 122 var attrs = listing[element].attributes; |
| 133 for (attr in attrs) { | 123 for (attr in attrs) { |
| 134 nullTestElementAttribute(type, elementToUse, attrs[attr].nam
e, attrs[attr].expectedNull); | 124 nullTestElementAttribute(type, elementToUse, attrs[attr].nam
e, attrs[attr].expectedNull); |
| 135 } | 125 } |
| 136 printOut(''); | 126 printOut(''); |
| 137 } | 127 } |
| 138 } | 128 } |
| 139 </script> | 129 </script> |
| 140 </head> | 130 </head> |
| 141 <body onload="runTests()"> | 131 <body onload="runTests()"> |
| 142 <p>This test setting various attributes of a CSSOM elements to JavaScript nu
ll.</p> | 132 <p>This test setting various attributes of a CSSOM elements to JavaScript nu
ll.</p> |
| 143 <div id="console"></div> | 133 <div id="console"></div> |
| 144 </body> | 134 </body> |
| 145 </html> | 135 </html> |
| OLD | NEW |