OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <meta charset="utf-8"> |
| 5 <title>HTML Test: The scoped attribute must apply the style information only
to its parent element</title> |
| 6 <link rel="author" title="Intel" href="http://www.intel.com/"> |
| 7 <link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-style-sc
oped"> |
| 8 <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-style-ele
ment"> |
| 9 <script src="../../../../../../resources/testharness.js"></script> |
| 10 <script src="../../../../../../resources/testharnessreport.js"></script> |
| 11 <style> |
| 12 #test { |
| 13 width: 50px; |
| 14 } |
| 15 </style> |
| 16 </head> |
| 17 <body> |
| 18 <div id="log"></div> |
| 19 <div id="test"></div> |
| 20 <div> |
| 21 <style id="style"> |
| 22 #test { |
| 23 width: 100px; |
| 24 } |
| 25 </style> |
| 26 <div> |
| 27 <script> |
| 28 test(function() { |
| 29 var testElement = document.getElementById("test"); |
| 30 var style = document.getElementById("style"); |
| 31 var width1, width2; |
| 32 |
| 33 width1 = window.getComputedStyle(testElement, false)["width"]; |
| 34 assert_equals(width1, "100px", "The style 'width' should be applied."); |
| 35 |
| 36 style.scoped = true; |
| 37 width2 = window.getComputedStyle(testElement, false)["width"]; |
| 38 assert_equals(width2, "50px", "The width should not be applied."); |
| 39 }, "The scoped attribute is present, the style information must be applied
only to its parent element"); |
| 40 </script> |
| 41 </body> |
| 42 </html> |
OLD | NEW |