aria-api

access ARIA information from JavaScript
git clone https://git.ce9e.org/aria-api.git

commit
388270ec1d1dbe2a7600e493a057d523ff198dff
parent
c0160bff94b457eb7a4818ddcb26b5445ddb3dc9
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2023-06-07 10:35
update selectors

html-aam-1.0 is still a working draft, so no version change

Diffstat

M lib/constants.js 43 +++++++++++++++++++++++--------------------

1 files changed, 23 insertions, 20 deletions


diff --git a/lib/constants.js b/lib/constants.js

@@ -66,13 +66,8 @@ exports.attributeWeakMapping = {
   66    66 	'selected': 'selected',
   67    67 };
   68    68 
   69    -1 var scoped = [
   70    -1 	'main *',
   71    -1 	// https://www.w3.org/TR/html/dom.html#sectioning-content-2
   72    -1 	'article *', 'aside *', 'nav *', 'section *',
   73    -1 	// https://www.w3.org/TR/html/sections.html#sectioning-roots
   74    -1 	'blockquote *', 'details *', 'dialog *', 'fieldset *', 'figure *', 'td *',
   75    -1 ].join(',');
   -1    69 // https://www.w3.org/TR/html/dom.html#sectioning-content-2
   -1    70 var scoped = ['article *', 'aside *', 'nav *', 'section *'].join(',');
   76    71 
   77    72 // https://www.w3.org/TR/html-aam-1.0/#html-element-role-mappings
   78    73 // https://www.w3.org/TR/wai-aria/roles
@@ -88,7 +83,7 @@ exports.roles = {
   88    83 		selectors: ['article'],
   89    84 	},
   90    85 	banner: {
   91    -1 		selectors: ['header:not(' + scoped + ')'],
   -1    86 		selectors: [`header:not(main *, ${scoped})`],
   92    87 	},
   93    88 	blockquote: {
   94    89 		selectors: ['blockquote'],
@@ -108,7 +103,7 @@ exports.roles = {
  108   103 		selectors: ['caption', 'figcaption'],
  109   104 	},
  110   105 	cell: {
  111    -1 		selectors: ['td'],
   -1   106 		selectors: ['td', 'th:not([scope])'],
  112   107 		childRoles: ['columnheader', 'gridcell', 'rowheader'],
  113   108 		nameFromContents: true,
  114   109 	},
@@ -148,13 +143,18 @@ exports.roles = {
  148   143 		childRoles: ['button', 'link', 'menuitem'],
  149   144 	},
  150   145 	complementary: {
  151    -1 		selectors: ['aside'],
   -1   146 		selectors: [
   -1   147 			`aside:not(${scoped})`,
   -1   148 			'aside[aria-label]',
   -1   149 			'aside[aria-labelledby]',
   -1   150 			'aside[title]',
   -1   151 		],
  152   152 	},
  153   153 	composite: {
  154   154 		childRoles: ['grid', 'select', 'spinbutton', 'tablist'],
  155   155 	},
  156   156 	contentinfo: {
  157    -1 		selectors: ['footer:not(' + scoped + ')'],
   -1   157 		selectors: [`footer:not(main *, ${scoped})`],
  158   158 	},
  159   159 	definition: {
  160   160 		selectors: ['dd'],
@@ -179,7 +179,7 @@ exports.roles = {
  179   179 		nameFromContents: true,
  180   180 	},
  181   181 	document: {
  182    -1 		selectors: ['body'],
   -1   182 		selectors: ['html'],
  183   183 		childRoles: ['article', 'graphics-document'],
  184   184 	},
  185   185 	emphasis: {
@@ -202,7 +202,13 @@ exports.roles = {
  202   202 		nameFromContents: true,
  203   203 	},
  204   204 	group: {
  205    -1 		selectors: ['details', 'optgroup'],
   -1   205 		selectors: [
   -1   206 			'address',
   -1   207 			'details',
   -1   208 			'fieldset',
   -1   209 			'hgroup',
   -1   210 			'optgroup',
   -1   211 		],
  206   212 		childRoles: ['row', 'select', 'toolbar', 'graphics-object'],
  207   213 	},
  208   214 	heading: {
@@ -259,16 +265,17 @@ exports.roles = {
  259   265 		],
  260   266 	},
  261   267 	link: {
  262    -1 		selectors: ['a[href]', 'area[href]', 'link[href]'],
   -1   268 		selectors: ['a[href]', 'area[href]'],
  263   269 		childRoles: ['doc-backlink', 'doc-biblioref', 'doc-glossref', 'doc-noteref'],
  264   270 		nameFromContents: true,
  265   271 	},
  266   272 	list: {
  267    -1 		selectors: ['dl', 'ol', 'ul'],
   -1   273 		selectors: ['dl', 'ol', 'ul', 'menu'],
  268   274 		childRoles: ['directory', 'feed'],
  269   275 	},
  270   276 	listbox: {
  271   277 		selectors: [
   -1   278 			'datalist',
  272   279 			'select[multiple]',
  273   280 			'select[size]:not([size="0"]):not([size="1"])',
  274   281 		],
@@ -277,7 +284,7 @@ exports.roles = {
  277   284 		},
  278   285 	},
  279   286 	listitem: {
  280    -1 		selectors: ['dt', 'ul > li', 'ol > li'],
   -1   287 		selectors: ['li'],
  281   288 		childRoles: ['doc-biblioentry', 'doc-endnote', 'treeitem'],
  282   289 	},
  283   290 	log: {
@@ -299,7 +306,6 @@ exports.roles = {
  299   306 		},
  300   307 	},
  301   308 	menu: {
  302    -1 		selectors: ['menu[type="context"]'],
  303   309 		childRoles: ['menubar'],
  304   310 		defaults: {
  305   311 			'orientation': 'vertical',
@@ -311,12 +317,10 @@ exports.roles = {
  311   317 		},
  312   318 	},
  313   319 	menuitem: {
  314    -1 		selectors: ['menuitem[type="command"]'],
  315   320 		childRoles: ['menuitemcheckbox'],
  316   321 		nameFromContents: true,
  317   322 	},
  318   323 	menuitemcheckbox: {
  319    -1 		selectors: ['menuitem[type="checkbox"]'],
  320   324 		childRoles: ['menuitemradio'],
  321   325 		nameFromContents: true,
  322   326 		defaults: {
@@ -324,7 +328,6 @@ exports.roles = {
  324   328 		},
  325   329 	},
  326   330 	menuitemradio: {
  327    -1 		selectors: ['menuitem[type="radio"]'],
  328   331 		nameFromContents: true,
  329   332 		defaults: {
  330   333 			'checked': 'false',