/
fix.pointer-focus-children.test.html
131 lines (113 loc) · 3.36 KB
/
fix.pointer-focus-children.test.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Fix Pointer Focus Children Browser Bug</title>
<style>
.flex {
display: -webkit-flexbox;
display: -ms-flexbox;
display: flex;
width: 300px;
}
.flex > span {
display: block;
-ms-flex: 1 1 100px;
flex: 1 1 10px;
}
body :focus {
outline: 1px solid red;
}
</style>
</head>
<body>
<h1>Unhandled Flexbox Click Focus</h1>
<h2>Natural</h2>
<div id="natural-fail-source" tabindex="-1">target</div>
<h2>Normal</h2>
<div id="normal-fail-target" tabindex="-1">
<span id="normal-fail-source">target</span>
</div>
<h2>Flexed Child</h2>
<div id="child-fail-target" tabindex="-1" class="flex">
<span id="child-fail-source">target</span>
<span>two</span>
</div>
<h2>Flexed Descendant</h2>
<div id="nested-fail-target" tabindex="-1">
<div id="nested-fail-wrapper" class="flex">
<span id="nested-fail-source">target</span>
<span>two</span>
</div>
</div>
<h2>Normal Redirect</h2>
<div id="redirect-fail-wrapper">
<input id="redirect-fail-target">
<label for="redirect-fail-target" id="redirect-fail-source">target</label>
</div>
<h2>Flexed Redirect</h2>
<div id="redirect-flexed-fail-wrapper">
<input id="redirect-flexed-fail-target">
<label for="redirect-flexed-fail-target" class="flex">
<span id="redirect-flexed-fail-source">target</span>
<span>two</span>
</label>
</div>
<hr>
<h1>Handled Flexbox Click Focus</h1>
<div id="engage-fix">
<h2>Natural</h2>
<div id="natural-fixed-source" tabindex="-1">target</div>
<h2>Normal</h2>
<div id="normal-fixed-target" tabindex="-1">
<span id="normal-fixed-source">target</span>
</div>
<h2>Flexed Child</h2>
<div id="child-fixed-target" tabindex="-1" class="flex">
<span id="child-fixed-source">target</span>
<span>two</span>
</div>
<h2>Flexed Descendant</h2>
<div id="nested-fixed-target" tabindex="-1">
<div id="nested-fixed-wrapper" class="flex">
<span id="nested-fixed-source">target</span>
<span>two</span>
</div>
</div>
<h2>Normal Redirect</h2>
<div id="redirect-fixed-wrapper">
<input id="redirect-fixed-target">
<label for="redirect-fixed-target" id="redirect-fixed-source">target</label>
</div>
<h2>Flexed Redirect</h2>
<div id="redirect-flexed-fixed-wrapper">
<input id="redirect-flexed-fixed-target">
<label for="redirect-flexed-fixed-target" class="flex">
<span id="redirect-flexed-fixed-source">target</span>
<span>two</span>
</label>
</div>
</div>
<script src="../../node_modules/requirejs/require.js"></script>
<script>
require.config({
paths: {
ally: '../../dist/amd',
// shims required by ally.js
'array.prototype.findindex': '../../node_modules/array.prototype.findindex/index',
'css.escape': '../../node_modules/css.escape/css.escape',
'platform': '../../node_modules/platform/platform',
}
});
require([
'ally/util/platform',
'ally/fix/pointer-focus-children',
], function(platform, fixPointerFocusChildren) {
window.platform = platform;
fixPointerFocusChildren({
context: '#engage-fix',
});
});
</script>
</body>
</html>