OLD | NEW |
(Empty) | |
| 1 <html xmlns="http://www.w3.org/1999/xhtml"> |
| 2 |
| 3 <style> |
| 4 @namespace myprefix url(banana); |
| 5 </style> |
| 6 <div id="target1" xmlns="banana"></div> |
| 7 <div id="target2" xmlns="apple"></div> |
| 8 <div id="target3" xmlns="mango"></div> |
| 9 |
| 10 <script src="../../../resources/testharness.js"></script> |
| 11 <script src="../../../resources/testharnessreport.js"></script> |
| 12 |
| 13 <script> |
| 14 test(function(){ |
| 15 var styleSheet = document.styleSheets[0]; |
| 16 styleSheet.insertRule('@namespace myprefix url("mango");', styleSheet.cssRul
es.length); |
| 17 styleSheet.insertRule('@namespace myprefix url("apple");', 0); |
| 18 styleSheet.insertRule('div { background-color: red; }', styleSheet.cssRules.
length); |
| 19 styleSheet.insertRule('myprefix|div { background-color: green; }', styleShee
t.cssRules.length); |
| 20 |
| 21 assert_equals(getComputedStyle(document.getElementById('target1')).backgroun
dColor, 'rgb(255, 0, 0)'); |
| 22 assert_equals(getComputedStyle(document.getElementById('target2')).backgroun
dColor, 'rgb(0, 128, 0)'); |
| 23 assert_equals(getComputedStyle(document.getElementById('target3')).backgroun
dColor, 'rgb(255, 0, 0)'); |
| 24 }, "If namespace prefix is declated more than once only the last declaration sho
uld be used"); |
| 25 </script> |
| 26 </html> |
OLD | NEW |