Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: third_party/WebKit/LayoutTests/accessibility/background-color.html

Issue 2006043002: Improved the reporting of background color information. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed to using 100% opacity and caching the background color value. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 is transparent.' );
aboxhall 2016/05/25 20:59:07 #transparent doesn't seem to me to have transparen
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 red
aboxhall 2016/05/25 20:59:07 Comment is inaccurate: that's more of a light grey
54 document.getElementById('blended-default').style.display = 'none';
55 }, 'Ensures that semi-transparent text 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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698