OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <link rel="stylesheet alternate" href="data:text/css,p { color:green }" title="p
refer"> |
| 5 <link rel="stylesheet alternate" href="data:text/css,p { color:red }" title="not
preferred"> |
| 6 <link id="l1" rel="stylesheet" title="notpreferred"> |
| 7 <link id="l2" rel="stylesheet" href title="notpreferred"> |
| 8 <link id="l3" rel="stylesheet" href="" title="notpreferred"> |
| 9 <link id="l4" rel="icon" href="data:text/css," title="notpreferred"> |
| 10 <link id="l5" rel="stylesheet" href="data:text/css,"> |
| 11 <p id="p1">This text should be green</p> |
| 12 <script> |
| 13 test(() => { |
| 14 assert_equals(getComputedStyle(p1).color, "rgb(0, 0, 0)"); |
| 15 }, "Check that #p1 is initially black."); |
| 16 |
| 17 test(() => { |
| 18 l1.setAttribute("title", "prefer"); |
| 19 assert_equals(getComputedStyle(p1).color, "rgb(0, 0, 0)"); |
| 20 }, "Do not set preferred set when href missing."); |
| 21 |
| 22 test(() => { |
| 23 l2.setAttribute("title", "prefer"); |
| 24 assert_equals(getComputedStyle(p1).color, "rgb(0, 0, 0)"); |
| 25 }, "Do not set preferred set when href has no value."); |
| 26 |
| 27 test(() => { |
| 28 l3.setAttribute("title", "prefer"); |
| 29 assert_equals(getComputedStyle(p1).color, "rgb(0, 0, 0)"); |
| 30 }, "Do not set preferred set when href has empty value."); |
| 31 |
| 32 test(() => { |
| 33 l4.setAttribute("title", "prefer"); |
| 34 assert_equals(getComputedStyle(p1).color, "rgb(0, 0, 0)"); |
| 35 }, "Do not set preferred set for rel=icon."); |
| 36 |
| 37 test(() => { |
| 38 l5.setAttribute("title", "prefer"); |
| 39 assert_equals(getComputedStyle(p1).color, "rgb(0, 128, 0)"); |
| 40 }, "Setting the title attribute set the preferred set."); |
| 41 </script> |
OLD | NEW |