This repository has been archived by the owner on Jun 25, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
taxonomy.html
515 lines (500 loc) · 16.5 KB
/
taxonomy.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
<!DOCTYPE html>
<html>
<head>
<meta name="generator" content=
"HTML Tidy for HTML5 for Mac OS X version 4.9.26">
<title>
Accessibility API: Taxonomies
</title>
<meta charset='utf-8'>
<script src='https://www.w3.org/Tools/respec/respec-w3c-common' async
class='remove'>
</script>
<script class='remove'>
/*Make tidy happy*/
var respecConfig = {
// specification status (e.g. WD, LCWD, WG-NOTE, etc.). If in doubt use ED.
specStatus: "unofficial",
// the specification's short name, as in http://www.w3.org/TR/short-name/
shortName: "a11y-api",
// if your specification has a subtitle that goes below the main
// formal title, define it here
// subtitle : "an excellent document",
// if you wish the publication date to be other than the last modification, set this
// publishDate: "2009-08-06",
// if the specification's copyright date is a range of years, specify
// the start date here:
// copyrightStart: "2005"
// if there is a previously published draft, uncomment this and set its YYYY-MM-DD date
// and its maturity status
// previousPublishDate: "1977-03-15",
// previousMaturity: "WD",
// if there a publicly available Editor's Draft, this is the link
// edDraftURI: "http://berjon.com/",
// if this is a LCWD, uncomment and set the end of its review period
// lcEnd: "2009-08-05",
// editors, add as many as you like
// only "name" is required
editors: [
{
name: "Alexander Surkov"
, url: "http://mozilla.org/"
, mailto: "surkov.alexander@gmail.com"
, company: "Mozilla"
, companyURL: "http://mozilla.com/"
},
{
name: "Marcos Caceres"
, url: "http://mozilla.org/"
, mailto: "mcaceres@mozilla.com"
, company: "Mozilla"
, companyURL: "http://mozilla.com/"
},
],
// name of the WG
// wg: "None",
// URI of the public WG page
// wgURI: "http://example.org/really-cool-wg",
// name (without the @w3c.org) of the public mailing to which comments are due
// wgPublicList: "spec-writers-anonymous",
// URI of the patent status for this WG, for Rec-track documents
// !!!! IMPORTANT !!!!
// This is important for Rec-track documents, do not copy a patent URI from a random
// document unless you know what you're doing. If in doubt ask your friendly neighbourhood
// Team Contact.
// wgPatentURI: "",
// !!!! IMPORTANT !!!! MAKE THE ABOVE BLINK IN YOUR HEAD
};
</script>
</head>
<body>
<section id='abstract'>
<p>
This is a supplementary document to <a href="index.html">Accessibility
API</a> specification. It introduces <a>accessible taxonomies</a>, the
hierarchies of <a>accessible properties</a> like <a>roles</a> and
<a>states</a>, and interconnections between them. The <a>assistive
technology</a> can extract information about taxonomies used in the
document. The web author can extend existing taxonomies to express
semantics of the content if he needs to.
</p>
</section>
<section id='sotd'>
<p>
This is a work in progress.
</p>
<section>
<h3>
Things we want feedback on!
</h3>
<ul>
<li>Question. Pros:... Cons:....
</li>
</ul>
</section>
</section>
<section>
<h2>
Taxonomy API
</h2>
<p>
The API provides bunch of interfaces that are used to obtain the
information about <a>accessible taxonomies</a> and to extend the
existing ones.
</p>
<section>
<h3>
Terms
</h3>
<p>
An <dfn data-lt="accessible taxonomies">accessible taxonomy</dfn> or
<dfn data-lt="taxonomies">taxonomy</dfn> of an <a>accessible
property</a> like <a>role</a> or <a>state</a> is a hierarchy of all
possible values of the <a>accessible property</a>. The taxonomy
describes each value by set of attributes, for example, it may
provide a human readable localized string for the property value.
Also the taxonomy describes interconnection between values from other
taxonomies, for example, <code>link</code> role may be connected to
<code>visited</code> state.
</p>
</section>
<section class="informative">
<h3>
Understanding the terms.
</h3>
<p>
Each <a>accessible element</a> is described by accessible properties
like <a>role</a>, <a>state</a>, <a>actions</a> etc. Every accessible
property may take a range of values, for example,
<code>checkbox</code> and <code>paragraph</code> as values for
<a>role</a>. All accessible properties may have various dependencies,
for example, <code>checked</code> state can be applied to
<code>checkbox</code> role, however it's not applicable to
<code>paragraph</code> role. Accessible property values and their
dependencies are structured into <a>taxonomies</a>. The <a>assistive
technology</a> can operate with them.
</p>
<p>
The values of accessible properties and their relations are specific
to a markup whose semantics they serve to express. If the web author
needs to expose the semantics of some new kind, for example, to
describe a music sheet, then he may need to introduce new roles,
states etc and describe them. To do so the web author needs to extend
existing <a>taxonomies</a>. The <a>assistive technology</a> will able
then to understand the semantics of the content and figure out a
connection between 'known' taxa. For example, if the web author
introduces <code>checklistitem</code> role which is compound from two
<code>checkbox</code> and <code>listitem</code> roles, i.e it
inherits properties of both of them then the web author should
integrate the new role into existing role hierarchy.
</p>
</section>
</section>
<section>
<h2>
Extension to the <code>AccessibleDocument</code> interface
</h2>
<p>
An <a>accessible document</a> provides a method to import taxonomies.
</p>
<pre class="idl">
partial interface AccessibleDocument {
Taxon? taxonOf(DOMString taxonomy, DOMString name);
void import(TaxaLibrary library);
};
</pre>
<section>
<h3>
<code>taxonOf</code> method
</h3>
<p>
Returns a taxon object of <code>Taxon</code> interface for the given
taxonomy and taxon name. Depending on the taxonomy the object may
implement other interfaces derived from <code>Taxon</code> interface.
For example, the returned object for the <code>role</code> taxonomy
implements <code>RoleTaxon</code> interface.
</p>
<p>
The example logs out the whole role taxonomy.
</p>
<pre class="example highlight">
function logRoleTree(taxon, level) {
for (let i = 0; i < taxon.children.length; i++) {
var child = taxon.children[i];
console.log(`{$level} ${child.name}`);
logRoleTree(child, `${level}.${i}`);
}
}
let taxon = document.a11ement.taxonOf('role', 'base');
logRoleTree(taxon);
</pre>
</section>
<section>
<h3>
<code>import</code> method
</h3>
<p>
Imports taxonomies from the given library into the document
taxonomies.
</p>
<p>
In the example bunch of ARIA DPUB roles are imported into document's
taxonomy.
</p>
<pre class="example highlight">
var DPUBRoles = {
appendix: {
description: "appendix",
parents: "section",
attributes: {
landmark: "appendix"
}
},
bibliography: {
description: "bibliography",
parents: "list",
attributes: {
landmark: "bibliography"
}
owns: "biblioentry"
},
biblioentry: {
description: "reference",
parents: "listitem"
}
};
document.a11ement.import({
id: 'ARIA:DPUB',
roles: DPUBRoles
});
</pre>
<p>
The method can be used to extend existing taxonomies. If, for
example, the library describes an role that exists in the taxonomy
then the role taxon is extended by new properties, if they don't
conflict to the existing ones. In latter case an exception is thrown.
</p>
<p>
In the example the root role taxon is extended by new <a>states</a>
and <a>relations</a>. These states and relations will be applicable
to all roles in the taxonomy.
</p>
<pre class="example highlight">
var library = {
roles: {
'*': {
states: [
'highlightable', 'highlighted'
],
relations: [
'highlight-comment-for',
'highlight-commented-by'
]
}
},
states: {
highlightable: { },
highlighted: {
description: 'user choice'
}
},
relations: {
'highlight-comment-for': { },
'highlight-commented-by': {
description: 'commented by'
}
}
}
</pre>
</section>
</section>
<section>
<h2>
TaxaLibrary dictionary
</h2>
<p>
A collection of taxonomies extensions to the document's taxonomies.
</p>
<pre class="idl">
dictionary TaxaLibrary {
DOMString id;
TaxaStack roles;
TaxaStack states;
TaxaStack attributes;
TaxaStack actions;
TaxaStack relations;
};
interface TaxaStack {
readonly maplike<DOMString, TaxonDict>;
};
</pre>
<section>
<h3>
<code>id</code> attribute
</h3>
<p>
The <code>id</code> attribute represents the library id, used for
identification proposes.
</p>
</section>
<section>
<h3>
<code>roles</code> attribute
</h3>
<p>
The <code>roles</code> attribute represents a collection of
<a>roles</a> injected into the browser's taxonomy by the library.
Returned object implements <code>TaxaStack</code> interface, which is
a map with <a>role</a> as a key and its description object as a
value. The role description object implements
<code>RoleTaxonDict</code> dictionary.
</p>
</section>
<section>
<h3>
<code>states</code> attribute
</h3>
<p>
The <code>states</code> attribute represents a collection of
<a>states</a> injected into the browser's taxonomy by the library.
Returned object implements <code>TaxaStack</code> interface, which is
a map with <a>state</a> as a key and its description object as a
value. The description object implements <code>TaxonDict</code>
dictionary.
</p>
</section>
<section>
<h3>
<code>attributes</code> attribute
</h3>
<p>
The <code>attributes</code> attribute represents a collection of
<a>attributes</a> injected into the browser's taxonomy by the
library. Returned object implements <code>TaxaStack</code> interface,
which is a map with <a>attribute</a> as a key and its description
object as a value. The description object implements
<code>TaxonDict</code> dictionary.
</p>
</section>
<section>
<h3>
<code>relations</code> attribute
</h3>
<p>
The <code>relations</code> attribute represents a collection of
<a>relations</a> injected into the browser's taxonomy by the library.
Returned object implements <code>TaxaStack</code> interface, which is
a map with <a>relation</a> as a key and its description object as a
value. The description object implements <code>TaxonDict</code>
dictionary.
</p>
</section>
</section>
<section>
<h2>
TaxonDict interface
</h2>
<p>
An object describing a taxon.
</p>
<pre class="idl">
dictionary TaxonDict {
DOMString description;
};
dictionary RoleTaxonDict : TaxonDict {
sequence<DOMString> parents;
sequence<DOMString> children;
sequence<DOMString> owns;
sequence<DOMString> states;
sequence<DOMString> attributes;
sequence<DOMString> relations;
sequence<DOMString> actions;
};
</pre>
<p>
<code>TaxonDict</code> and <code>RoleTaxonDict</code> dictionaries is a
replication of corresponding <code>Taxon</code> and
<code>RoleTaxon</code> interfaces.
</p>
</section>
<section>
<h2>
<code>Taxon</code> interface
</h2>
<p>
An object containing a name and description of a taxon.
</p>
<pre class="idl">
interface Taxon {
stringifier readonly attribute DOMString name;
readonly attribute DOMString description;
};
</pre>
</section>
<section>
<h2>
<code>RoleTaxon</code> interface
</h2>
<p>
An object describing <a>role</a> taxon.
</p>
<pre class="idl">
[NoInterfaceObject]
interface RoleTaxon : Taxon {
readonly attribute sequence<RoleTaxon> parents;
readonly attribute sequence<RoleTaxon> children;
readonly attribute sequence<RoleTaxon> owns;
readonly attribute sequence<DOMString> states;
readonly attribute object attributes;
readonly attribute object relations;
reaodnly attribute sequence<Taxon> actions;
};
</pre>
<section class="informative">
<h3>
Example of usage
</h3>
<p>
Example of a script that logs to console all accessible element
states.
</p>
<pre class="example highlight">
let al = document.getElementById("foo").a11ement;
for (let state of al.states) {
console.log(state);
}
</pre>
</section>
</section>
<section>
<h2>
Dependencies
</h2>
<p>
The following definitions are in the [[!Accessible API]] specification:
</p>
<ul>
<li>
<a href="index.html#dfn-assistive-technology"><dfn>assistive
technology</dfn></a>
</li>
<li>
<a href="index.html#dfn-accessible-element"><dfn data-lt=
"accessible elements">accessible element</dfn></a>
</li>
<li>
<a href="index.html#dfn-accessible-property"><dfn data-lt=
"accessible properties">accessible property</dfn></a>
</li>
<li>
<a href="index.html#dfn-role"><dfn data-lt="roles">role</dfn></a>
</li>
<li>
<a href="index.html#dfn-state"><dfn data-lt="states">state</dfn></a>
</li>
<li>
<a href="index.html#dfn-name"><dfn data-lt="names">name</dfn></a>
</li>
<li>
<a href="index.html#dfn-description"><dfn data-lt=
"descriptions">description</dfn></a>
</li>
<li>
<a href="index.html#dfn-text"><dfn data-lt="texts">text</dfn></a>
</li>
<li>
<a href="index.html#dfn-attribute"><dfn data-lt=
"attributes">attribute</dfn></a>
</li>
<li>
<a href="index.html#dfn-pattern"><dfn data-lt=
"patterns">pattern</dfn></a>
</li>
<li>
<a href="index.html#dfn-relation"><dfn data-lt=
"relations">relation</dfn></a>
</li>
<li>
<a href="index.html#dfn-user-action"><dfn data-lt=
"actions">action</dfn></a>
</li>
<li>
<a href="index.html#dfn-device-dependent-interaction"><dfn data-lt=
"device-dependent interactions">device-dependent-interaction</dfn></a>
</li>
<li>
<a href="index.html#dfn-accessible-tree"><dfn data-lt=
"accessible trees">accessible tree</dfn></a>
</li>
</ul>
</section>
<section class='appendix'>
<h2>
Acknowledgements
</h2>
<p>
Many thanks to.
</p>
</section>
</body>
</html>