OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/testharness.js"></script> |
| 3 <script src="../../../resources/testharnessreport.js"></script> |
| 4 <style> |
| 5 option, optgroup { color: red } |
| 6 .green { color: green } |
| 7 </style> |
| 8 <div style="display:none"> |
| 9 <option id="opt"></option> |
| 10 </div> |
| 11 <div style="display:none"> |
| 12 <optgroup id="optgroup"></optgroup> |
| 13 </div> |
| 14 <div style="display:none"> |
| 15 <optgroup> |
| 16 <option id="optingroup"></option> |
| 17 </optgroup> |
| 18 </div> |
| 19 <script> |
| 20 test(() => assert_equals(getComputedStyle(opt).color, "rgb(255, 0, 0)", "Opt
ion color was not red before change."), "Option color before change."); |
| 21 test(() => assert_equals(getComputedStyle(optgroup).color, "rgb(255, 0, 0)",
"Optgroup color was not red before change."), "Optgroup color before change."); |
| 22 test(() => assert_equals(getComputedStyle(optingroup).color, "rgb(255, 0, 0)
", "Option in optgroup color was not red before change."), "Option in optgroup c
olor before change."); |
| 23 test(() => { |
| 24 opt.className = "green"; |
| 25 assert_equals(getComputedStyle(opt).color, "rgb(0, 128, 0)", "Option col
or was not green after change."); |
| 26 }, "Option color after class change."); |
| 27 test(() => { |
| 28 optgroup.className = "green"; |
| 29 assert_equals(getComputedStyle(optgroup).color, "rgb(0, 128, 0)", "Optgr
oup color was not green after change."); |
| 30 }, "Optgroup color after class change."); |
| 31 test(() => { |
| 32 optingroup.className = "green"; |
| 33 assert_equals(getComputedStyle(optingroup).color, "rgb(0, 128, 0)", "Opt
ion in optgroup color was not green after change."); |
| 34 }, "Option in optgroup color after class change."); |
| 35 </script> |
OLD | NEW |