OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <meta charset="utf-8"> |
| 5 <title>HTML Test: Styling</title> |
| 6 <link rel="author" title="Intel" href="http://www.intel.com/"> |
| 7 <link rel="help" href="https://html.spec.whatwg.org/multipage/#styling"> |
| 8 <link id="style1" rel="text" title="Intel" href="./support/unmatch.css"> |
| 9 <link id="style2" rel="alternate stylesheet" type="text/css" title="" href="
./support/emptytitle.css"> |
| 10 <link id="style3" rel="alternate stylesheet" type="text/css" href="./support
/notitle.css"> |
| 11 <link id="style5" rel="stylesheet" type="text/css" href="./support/normal.cs
s"> |
| 12 <link id="style6" rel="alternate stylesheet" type="text/css" href="./support
/normal.css" title="./support/alternate.css"> |
| 13 <script src="../../../../../../resources/testharness.js"></script> |
| 14 <script src="../../../../../../resources/testharnessreport.js"></script> |
| 15 <style id="style4" type="text/html"> |
| 16 #test { |
| 17 height: 100px; |
| 18 width: 100px; |
| 19 } |
| 20 </style> |
| 21 <style id="style7" type="text/css" media="all" title="./support/alternate.cs
s"> |
| 22 #test { |
| 23 background-color: green; |
| 24 } |
| 25 </style> |
| 26 </head> |
| 27 <body> |
| 28 <div id="log"></div> |
| 29 <div id="test" style="display:none">STYLING TEST</div> |
| 30 |
| 31 <script> |
| 32 test(function() { |
| 33 var style = null, |
| 34 i; |
| 35 for (i = 1; i < 5; i++) { |
| 36 style = document.getElementById("style" + i); |
| 37 assert_equals(style.sheet, null, "The sheet attribute of style" + i +
" should be null."); |
| 38 assert_false(style.disabled, "The disabled attribute of style" + i + "
should be false."); |
| 39 } |
| 40 }, "The LinkStyle interface's sheet attribute must return null; the disabl
ed attribute must be false"); |
| 41 |
| 42 test(function() { |
| 43 var style = document.createElement("style"), |
| 44 link = document.createElement("link"); |
| 45 assert_equals(style.sheet, null, "The sheet attribute of the style eleme
nt not in a document should be null."); |
| 46 assert_equals(link.sheet, null, "The sheet attribute of the link element
not in a document should be null."); |
| 47 }, "The LinkStyle interface's sheet attribute must return null if the corr
esponding element is not in a Document"); |
| 48 |
| 49 test(function() { |
| 50 var style = null, |
| 51 i; |
| 52 for (i = 5; i < 8; i++) { |
| 53 style = document.getElementById("style" + i); |
| 54 assert_true(style.sheet instanceof StyleSheet, "The sheet attribute of
style" + i + " should be a StyleSheet object."); |
| 55 assert_equals(style.disabled, style.sheet.disabled, "The disabled attr
ibute of style" + i + " should equal to the same attribute of StyleSheet."); |
| 56 } |
| 57 }, "The LinkStyle interface's sheet attribute must return StyleSheet objec
t; the disabled attribute must be same as the StyleSheet's disabled attribute"); |
| 58 |
| 59 test(function() { |
| 60 assert_equals(document.getElementById("style2").title, "", "The title at
tribute of style2 is incorrect."); |
| 61 assert_equals(document.getElementById("style5").title, "", "The title at
tribute of style5 is incorrect."); |
| 62 assert_equals(document.getElementById("style6").title, "./support/altern
ate.css", "The title attribute of style6 is incorrect."); |
| 63 assert_equals(document.getElementById("style7").title, "./support/altern
ate.css", "The title attribute of style7 is incorrect."); |
| 64 }, "The title must be the same as the value of the element's title content
attribute"); |
| 65 |
| 66 test(function() { |
| 67 assert_equals(document.getElementById("style5").media, "", "The media at
tribute of style5 is incorrect."); |
| 68 assert_equals(document.getElementById("style7").media, "all", "The media
attribute of style7 is incorrect."); |
| 69 }, "The media must be the same as the value of the element's media content
attribute, or the empty string if it is omitted"); |
| 70 </script> |
| 71 </body> |
| 72 </html> |
OLD | NEW |