/
2d.drawFocusIfNeeded.defaultpathcompositing-manual.html
48 lines (44 loc) · 2.19 KB
/
2d.drawFocusIfNeeded.defaultpathcompositing-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
<!DOCTYPE html>
<html>
<head>
<title>drawFocusIfNeeded when a default path is provided, the associated fallback element has focus and shadowColor='green', shadowOffsetX=4, shadowOffset=5, globalAlpha="1.0", and globalComposition='xor'</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 focus indicator is drawn when a default path is provided with Shadow and Compositing effects and the associated fallback element's focus can still be determined. This test passes if a focus indicator is present (square).</p>
<div>
<p>focus indicator on element with with Shadow and Compositing effects:</p>
<canvas height='100' width='100' id='canvas'>
<a href='http://www.w3.org' id='focus'>Focus</a>
</canvas>
</div>
<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.shadowColor='green';
context.shadowOffsetX=4;
context.shadowOffset=5;
context.globalAlpha='1.0';
context.globalComposition='xor';
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 shadowColor="green", shadowOffsetX=4, shadowOffset=5, globalAlpha="1.0", and globalComposition="xor"');
</script>
<div id="log"></div>
<!-- 2.8 drawFocusIfNeeded when a default path is provided, the associated fallback element has focus and shadowColor='green', shadowOffsetX=4, shadowOffset=5, globalAlpa="1.0", and globalComposition='xor' -->
</body>
</html>