| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../resources/testharness.js"></script> |
| 3 <script src="../resources/testharnessreport.js"></script> |
| 4 |
| 5 <!-- The default document base color is white. --> |
| 6 <div id="default">Document base color.</div> |
| 7 |
| 8 <div style="background-color: blue"> |
| 9 <p id="transparent" style="background-color: transparent">Transparent color.
</p> |
| 10 </div> |
| 11 |
| 12 <div style="background-color: blue"> |
| 13 <div style="background-color: green"> |
| 14 <p id="obscuring-background" style="background-color: transparent">Obscu
ring background.</p> |
| 15 </div> |
| 16 </div> |
| 17 |
| 18 <p id="blended-default" style="background-color: rgba(50%, 50%, 50%, 0.5)"> |
| 19 Blended with document base color. |
| 20 </p> |
| 21 |
| 22 <div style="background-color: rgba(50%, 50%, 50%, 0.5)"> |
| 23 <p id="blended-background" style="background-color: rgba(50%, 50%, 50%, 0.5)
"> |
| 24 Blended with background color. |
| 25 </p> |
| 26 </div> |
| 27 |
| 28 <script> |
| 29 test(function() |
| 30 { |
| 31 var axDefault = accessibilityController.accessibleElementById('default'); |
| 32 assert_equals(axDefault.backgroundColor, 0xffffffff); // White |
| 33 document.getElementById('default').style.display = 'none'; |
| 34 }, 'Ensures that the document base color is exposed.'); |
| 35 |
| 36 test(function() |
| 37 { |
| 38 var axTransparent = accessibilityController.accessibleElementById('transpare
nt'); |
| 39 assert_equals(axTransparent.backgroundColor, 0xff0000ff); // Blue |
| 40 document.getElementById('transparent').style.display = 'none'; |
| 41 }, 'Ensures that the color of the parent is exposed if the text background is tr
ansparent.'); |
| 42 |
| 43 test(function() |
| 44 { |
| 45 var axObscuring = accessibilityController.accessibleElementById('obscuring-b
ackground'); |
| 46 assert_equals(axObscuring.backgroundColor, 0xff008000); // Green |
| 47 document.getElementById('obscuring-background').style.display = 'none'; |
| 48 }, 'Ensures that the color of the parent is the only one exposed if it is not tr
ansparent.'); |
| 49 |
| 50 test(function() |
| 51 { |
| 52 var axBlended = accessibilityController.accessibleElementById('blended-defau
lt'); |
| 53 assert_equals(axBlended.backgroundColor, 0xffbfbfbf); // Lite gray |
| 54 document.getElementById('blended-default').style.display = 'none'; |
| 55 }, 'Ensures that semi-transparent text background color is blended with document
base color.'); |
| 56 |
| 57 test(function() |
| 58 { |
| 59 var axBlended = accessibilityController.accessibleElementById('blended-backg
round'); |
| 60 assert_equals(axBlended.backgroundColor, 0xff9f9f9f); // Medium gray |
| 61 document.getElementById('blended-background').style.display = 'none'; |
| 62 }, 'Ensures that background colors of overlapping objects are blended.'); |
| 63 </script> |
| OLD | NEW |