/
2d.drawFocusIfNeeded.defaultpathhighcontrast-manual.html
54 lines (51 loc) · 2.54 KB
/
2d.drawFocusIfNeeded.defaultpathhighcontrast-manual.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html>
<head>
<title>drawFocusIfNeeded when a default path is provided the associated fallback element has focus and the system is in a high contrast mode</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<link rel="author" title="Mark Sadecki">
<link rel="help" href="http://www.w3.org/TR/2dcontext/#dom-context-2d-drawfocusifneeded">
</head>
<body>
<h1>Description</h1>
<p>This test verifies that a detectable focus indicator is drawn when a default path is provided the associated fallback element has focus and the system is in a high contrast mode. This test requires you to <a href="#guidance">configure your desktop environment for high contrast mode</a>. This test passes if a focus indicator is clearly visible when in high contrast mode (square).</p>
<div>
<p>focus indicator:</p>
<canvas height='100' width='100' id='canvas'>
<a href='http://www.w3.org' id='focus'>Focus</a>
</canvas>
</div>
<h2 id='guidance'>Guidance for configuring High Contrast mode</h2>
<p>The following instructions should give you enough information to put your desktop environmnet in High Contrast mode. Requirements for your particular environment may differ from the instructions provided:</p>
<dl>
<dt>Windows</dt>
<dd>Open 'Display -> Preferences' or 'Ease of Access -> High Contrast'</dd>
<dd>Choose one of the High Contrast themes available.</dd>
<dt>Mac</dt>
<dd>Open 'System Preferences -> Accessibility -> Display.'</dd>
<dd>Check 'Invert colors' checkbox.</dd>
<dt>Gnome</dt>
<dd></dd>
</dl>
<script>
test(function() {
// default path associated fallback has focus
var canvas = document.getElementById('canvas');
var focus = document.getElementById('focus');
var context = canvas.getContext('2d');
context.beginPath();
context.rect(10, 10, 80, 80);
context.fillStyle = "white";
context.fill();
focus.focus();
context.drawFocusIfNeeded(focus);
/*// TODO make test automated
assert_false(assertion, "Failure");
*/
}, 'drawFocusIfNeeded when a default path is provided, the associated fallback element has focus and the system is in a high contrast mode');
</script>
<div id="log"></div>
<!-- 2.7 drawFocusIfNeeded when a default path is provided, the associated fallback element has focus and the system is in a high contrast mode -->
</body>
</html>